llbbl
09-01-2004, 06:51 AM
1
c h a p t e r
1
Having Linux and
Windows on the Same PC
1.1 Partitions
There is no need to get rid of Windows to run Linux. In fact, there are many ways to run
both of them on the same PC. Each operating system has its own strengths and weaknesses,
so often having both on the same PC can be an advantage.
Before the actual installation, we need to go over some basics of Linux and Windows
such as partitions and filesystems.
A partition is a way of sectioning off space on a hard drive. Most PCs have their hard
drive partitioned into one large drive. It doesn’t have to be this way. Drives can be divided
into several partitions. This is often done to separate the programs from the data and also
for storing multiple operating systems on the same drive.
The first section of a hard drive contains information on the partitions, including where the
start and end of each partition is located. It also contains the location of the boot loader, which
starts loading the operating system. Each operating system has its own boot loader. Windows 3x,
95, and 98 use
IO.SYS
and
DOS.SYS
, Windows NT uses
NTLOADER
, and Linux uses
LILO
. There
are also commercial and shareware boot loaders, such as Norton System Commander, that are
designed to make it easier to boot with multiple configurations and multiple operating systems.
1.2 Filesystems
There are also several different filesystems used by Linux and Windows. A filesystem is
simply a way of organizing files on a partition. Windows uses FAT, FAT16, FAT32 (VFAT),
and NTFS (NT Filesystem). The native filesystem for Linux is ext2, although it supports
many other filesystems.
FAT is the original filesystem used by DOS. It is an eight-bit filesystem and will support
partitions of up to 32 MB. This was no problem in the early 1980s, when most PCs didn’t
even have hard drives.
FAT supports the following file attributes:
• Read-only—When set, the file can’t be deleted or changed.
• Archive—Determines whether a file has been changed. This is used by many backup
programs.
McCune01.fm Page 1 Friday, November 10, 2000 4:31 PM
2
Chapter 1 • Having Linux and Windows on the Same PC
• Hidden—The file doesn’t show up in the directory contents.
• System—Used for system files. System files are treated differently by the
operating system.
Later, as hard drives came into use, the 32 MB limitation of FAT became a burden and
an improved FAT16 replaced it. FAT16 increased the available size of the filesystem to 2
GB. Other than the filesystem size, FAT16 is essentially the same as the original FAT filesystem.
FAT16 is supported by DOS 4.0 and greater, all versions of Windows, and all current
versions of Linux.
With Windows 95 release 2, Microsoft introduced FAT32. This increased the size of the
filesystem to 2 terabytes, which is larger than any hard drives currently available for PCs.
It is also faster and more robust than FAT16.
NTFS is the native filesystem for Windows NT and 2000. Like FAT32, it also supports
2-terabyte filesystem sizes, but the boot partition is currently limited to 7.8 GB. For some
files such as database files, NTFS can support up to 16 exabytes. NTFS offers better reliability
and security than any FAT-based filesystem.
The reliability factors are beyond the scope of this book, but NTFS security considerations
need to be covered. First of all, everything in the filesystem has an owner. By default,
the user who creates an object (anything in the filesystem is an object) is the owner. The
owner has full rights to the object unless the rights are taken away.
There are also groups, which contain users. Three special group accounts are: administrator,
everyone, and guest.
• The administrator account has all rights to the filesystem. This account can change,
create, and delete all objects as well as change the rights of other accounts.
• Everyone is a group that includes all the user accounts on the system. This account is
used to change the rights for every user on the system.
• The guest account is a default account with minimal rights. It is often used for
accounts such as FTP access accounts, which only need access to a few specific files.
Files in NTFS have the same attributes as files in the FAT filesystem: read-only, hidden,
system, and archive. Each user and group can also be assigned rights to objects in the NTFS
filesystem. The rights that can be assigned are:
• List folder contents—Shows up in a directory listing.
• Read—Can read the contents of the object.
• Read and execute—Can read and execute the object.
• Write—Can change or delete the object.
• Modify—Can change the rights on the file.
• Full control—Has all of the above rights.
There are three settings for the rights: allow, deny, and inherited.
• Allow—Allows rights on the object.
• Deny—Takes away rights on the object.
• Inherited—If neither allow nor deny is specified, the object will inherit the rights of
the directory above it.
McCune01.fm Page 2 Friday, November 10, 2000 4:31 PM
1.3 Partition Naming
3
To view the rights of an object on NTFS, right-click on the object and choose Properties.
Then select the Security tab.
Ext or ext2 is the native filesystem for Linux partitions. Ext is the original filesystem for
Linux and ext2 is an improved version of it. Objects (such as files, directories, and devices)
in Linux support three properties: read, write, and execute.
• Read—If set, allows the object to show up in a directory listing and be read.
• Write—If set, allows the object to be written and deleted.
• Execute—If set, allows the object to be executed. This must also be set for directories.
An object has three sets of rights: owner, group, and everyone.
• Owner—The user who created the file, unless it is changed.
• Group—The group that owns the file is the group to which the owner belongs, unless
it is changed.
• Everyone—The right for all other users on the system.
To view the rights of an object, type
ls -l <object name>
. For example, to find the
rights of
index.txt
, type
ls -l index.txt
. The output of this command is as follows:
-rwxrwxr-- 1 root root 6230 Dec 21 00:12 index.txt
Let’s examine what this output means, starting with the first character:
• First character—This is a special attribute such as a directory, link, or device
driver. A link in Linux is similar to a shortcut in Windows.
• Next three characters (
rwx
)—The owner has read, write, and execute properties.
• Next three characters (
rwx
)—The group has read, write, and execute properties.
• Next three characters (
r--
)—Everyone has the read property.
•
1 root
—The owner’s ID number and name.
•
root
—The group name, which is also
root
.
•
6230
—The size of the file in bytes.
•
Dec 21 00:12
—The last date and time the file was modified.
•
index.txt
—The filename.
You can change the rights of a file with
chmod
. The owner and group can be changed
with
chown
.
There is one special account in Linux:
root
. The root account is created automatically
when Linux is installed and it has full rights to all objects in the filesystem.
1.3 Partition Naming
Linux and Windows have different ways of naming partitions. Windows simply assigns each
partition a letter starting with C. Letters A and B are reserved for floppy drives, since the
first PCs came with two floppy drives. The remaining drive letters are assigned as follows:
McCune01.fm Page 3 Friday, November 10, 2000 4:31 PM
4
http://www.informit.com/content/images/0130306703/samplechapter/0130306703.pdf
Buy it here:
http://www.informit.com/title/0130306703&aid=3F57BAFE-6844-4E3E-B416-1E4E8B625D34&p=SFCPBAS
c h a p t e r
1
Having Linux and
Windows on the Same PC
1.1 Partitions
There is no need to get rid of Windows to run Linux. In fact, there are many ways to run
both of them on the same PC. Each operating system has its own strengths and weaknesses,
so often having both on the same PC can be an advantage.
Before the actual installation, we need to go over some basics of Linux and Windows
such as partitions and filesystems.
A partition is a way of sectioning off space on a hard drive. Most PCs have their hard
drive partitioned into one large drive. It doesn’t have to be this way. Drives can be divided
into several partitions. This is often done to separate the programs from the data and also
for storing multiple operating systems on the same drive.
The first section of a hard drive contains information on the partitions, including where the
start and end of each partition is located. It also contains the location of the boot loader, which
starts loading the operating system. Each operating system has its own boot loader. Windows 3x,
95, and 98 use
IO.SYS
and
DOS.SYS
, Windows NT uses
NTLOADER
, and Linux uses
LILO
. There
are also commercial and shareware boot loaders, such as Norton System Commander, that are
designed to make it easier to boot with multiple configurations and multiple operating systems.
1.2 Filesystems
There are also several different filesystems used by Linux and Windows. A filesystem is
simply a way of organizing files on a partition. Windows uses FAT, FAT16, FAT32 (VFAT),
and NTFS (NT Filesystem). The native filesystem for Linux is ext2, although it supports
many other filesystems.
FAT is the original filesystem used by DOS. It is an eight-bit filesystem and will support
partitions of up to 32 MB. This was no problem in the early 1980s, when most PCs didn’t
even have hard drives.
FAT supports the following file attributes:
• Read-only—When set, the file can’t be deleted or changed.
• Archive—Determines whether a file has been changed. This is used by many backup
programs.
McCune01.fm Page 1 Friday, November 10, 2000 4:31 PM
2
Chapter 1 • Having Linux and Windows on the Same PC
• Hidden—The file doesn’t show up in the directory contents.
• System—Used for system files. System files are treated differently by the
operating system.
Later, as hard drives came into use, the 32 MB limitation of FAT became a burden and
an improved FAT16 replaced it. FAT16 increased the available size of the filesystem to 2
GB. Other than the filesystem size, FAT16 is essentially the same as the original FAT filesystem.
FAT16 is supported by DOS 4.0 and greater, all versions of Windows, and all current
versions of Linux.
With Windows 95 release 2, Microsoft introduced FAT32. This increased the size of the
filesystem to 2 terabytes, which is larger than any hard drives currently available for PCs.
It is also faster and more robust than FAT16.
NTFS is the native filesystem for Windows NT and 2000. Like FAT32, it also supports
2-terabyte filesystem sizes, but the boot partition is currently limited to 7.8 GB. For some
files such as database files, NTFS can support up to 16 exabytes. NTFS offers better reliability
and security than any FAT-based filesystem.
The reliability factors are beyond the scope of this book, but NTFS security considerations
need to be covered. First of all, everything in the filesystem has an owner. By default,
the user who creates an object (anything in the filesystem is an object) is the owner. The
owner has full rights to the object unless the rights are taken away.
There are also groups, which contain users. Three special group accounts are: administrator,
everyone, and guest.
• The administrator account has all rights to the filesystem. This account can change,
create, and delete all objects as well as change the rights of other accounts.
• Everyone is a group that includes all the user accounts on the system. This account is
used to change the rights for every user on the system.
• The guest account is a default account with minimal rights. It is often used for
accounts such as FTP access accounts, which only need access to a few specific files.
Files in NTFS have the same attributes as files in the FAT filesystem: read-only, hidden,
system, and archive. Each user and group can also be assigned rights to objects in the NTFS
filesystem. The rights that can be assigned are:
• List folder contents—Shows up in a directory listing.
• Read—Can read the contents of the object.
• Read and execute—Can read and execute the object.
• Write—Can change or delete the object.
• Modify—Can change the rights on the file.
• Full control—Has all of the above rights.
There are three settings for the rights: allow, deny, and inherited.
• Allow—Allows rights on the object.
• Deny—Takes away rights on the object.
• Inherited—If neither allow nor deny is specified, the object will inherit the rights of
the directory above it.
McCune01.fm Page 2 Friday, November 10, 2000 4:31 PM
1.3 Partition Naming
3
To view the rights of an object on NTFS, right-click on the object and choose Properties.
Then select the Security tab.
Ext or ext2 is the native filesystem for Linux partitions. Ext is the original filesystem for
Linux and ext2 is an improved version of it. Objects (such as files, directories, and devices)
in Linux support three properties: read, write, and execute.
• Read—If set, allows the object to show up in a directory listing and be read.
• Write—If set, allows the object to be written and deleted.
• Execute—If set, allows the object to be executed. This must also be set for directories.
An object has three sets of rights: owner, group, and everyone.
• Owner—The user who created the file, unless it is changed.
• Group—The group that owns the file is the group to which the owner belongs, unless
it is changed.
• Everyone—The right for all other users on the system.
To view the rights of an object, type
ls -l <object name>
. For example, to find the
rights of
index.txt
, type
ls -l index.txt
. The output of this command is as follows:
-rwxrwxr-- 1 root root 6230 Dec 21 00:12 index.txt
Let’s examine what this output means, starting with the first character:
• First character—This is a special attribute such as a directory, link, or device
driver. A link in Linux is similar to a shortcut in Windows.
• Next three characters (
rwx
)—The owner has read, write, and execute properties.
• Next three characters (
rwx
)—The group has read, write, and execute properties.
• Next three characters (
r--
)—Everyone has the read property.
•
1 root
—The owner’s ID number and name.
•
root
—The group name, which is also
root
.
•
6230
—The size of the file in bytes.
•
Dec 21 00:12
—The last date and time the file was modified.
•
index.txt
—The filename.
You can change the rights of a file with
chmod
. The owner and group can be changed
with
chown
.
There is one special account in Linux:
root
. The root account is created automatically
when Linux is installed and it has full rights to all objects in the filesystem.
1.3 Partition Naming
Linux and Windows have different ways of naming partitions. Windows simply assigns each
partition a letter starting with C. Letters A and B are reserved for floppy drives, since the
first PCs came with two floppy drives. The remaining drive letters are assigned as follows:
McCune01.fm Page 3 Friday, November 10, 2000 4:31 PM
4
http://www.informit.com/content/images/0130306703/samplechapter/0130306703.pdf
Buy it here:
http://www.informit.com/title/0130306703&aid=3F57BAFE-6844-4E3E-B416-1E4E8B625D34&p=SFCPBAS