Linux Security Debian Slax Tiny Core Health

Linux

If a Computer Won't Start from a CD, DVD or USB Drive

Filesystems

Partitioning

Live CDs for Partitioning

Grub

Master Boot Record

Root Terminal

Root File Manager

Root Text Editor

File Ownership

File Permissions

List the Contents of a Directory

Change Directory

Mount a Drive or Partition

Mount an ISO Image Without Writing it to a CD or DVD

Download Large Files

Other Commands

Dial Up Modems

Linux Links


Other Links


Contact Details

Linux

Partitioning

Backup Your Files

When partitioning a hard drive or USB drive, you will lose everything on the drive. Before beginning, save a copy of all files you want to keep.


Guided Partitioning

When installing most Linux distributions, the simplest way to partition a hard drive is to select "Guided - use entire disk." This will use the entire hard drive, and automatically partition it.


Two Operating Systems on Two Hard Drives

You may have two hard drives, and install an operating system on each.

Guided partitioning can be used for this. You must select the correct hard drive when installing each operating system.

To have a grub menu, where you select which operating system you want to use each time you start the computer, Linux must be installed on the hard drive the computer reads from first when it starts, and Linux must be installed last, unless you manually edit the Grub menu, and set up the Master Boot Record.

While Grub (Grand United Bootloader) is the most common, some Linux distributions use programs other than Grub for a start menu.


Manual Partitioning

Manual partitioning can be used to set up multiple partitions on hard drives.


Primary, Extended and Logical Partitions

One hard drive can have a maximum of four primary partitions.

If you want more than four partitions, you can create an extended partition in the place of one of the primary partitions, and create logical partitions within it. For example, if you want eight partitions on one hard drive, you can have three primary partitions, and (one extended partition, containing) five logical partitions.


Linux Partitions

Two partitions are needed for one version of Linux, a root partition and a swap partition.

The root partition is where the files go, and takes up all of the space on the hard drive not used by swap. It has mount point / (written as forward slash and called root). Any partition, primary or logical, can be used for a Linux partition. Linux root partitions are normally formatted using the Ext3 filesystem. Some recent versions of Linux use the Ext4 filesystem, which will become widely used in the future.

A swap partition, which may be called swap area or Linux swap, enables part of the hard drive to be used like extra RAM. A suggested size, is double the RAM. Any partition, primary or logical, can be used for swap. However, it is common practice to use the first logical partition.

To illustrate how partition sizes are calculated, let's imagine a computer has 4 gb of ram and a 500 gb hard drive. The suggested size for the swap partition would be 8 gb (double the ram). The root partition will then be 492 gb (hard drive size less swap). When using manual partitioning, make calculations for the particular computer.

With some partitioning programs, partition size needs to be entered in megabytes not gigabytes. There are 1000 megabytes to a gigabyte. Using the above example, the root partition would be 492000 mb, and there would be approximately 8000 mb remaining for swap. Don't expect this to be exact. When partitioning drives, note whether the partition size needs to be entered in magabytes or gigabytes.

To install more than one version of Linux on a computer, a root partition is needed for each version, and only one swap partition which can be used by all. For example, to install three versions of Linux on one computer, you will need three root partitions and one swap partition.

Linux can be set up with different directories in different partitions, but this is not necessary. For example, you can have the home directory, where personal files are saved, in a different partition.


Windows Partitions

One partition is needed for one version of Windows. Windows creates a swap file inside the partition.

More than one version of Windows can be installed on one hard drive. A partition is needed for each.

Windows can only be installed in a primary partition, not a logical partition.

Recent versions of Windows use NTFS. Older versions such as Windows 98 and Windows ME use FAT32.

The Windows partition must be set to "Active" in Windows, which is the same as "Boot" if using GParted. Recent versions of Windows automatically do this during installation. If installing an older version of Windows, you need to set the partition as active or boot.

To set up Grub for more than one version of Windows, see Grub.


Formatting

Formatting a partition deletes much of what was there previously. If you install an operating system without formatting the partition, something already on the hard drive is likely to cause problems during installation. To avoid this, always format partitions before installing an operating system. This applies to all types of operating systems. Some partitioning programs may format partitions automatically. Others require you to select "Format the Partition," or something similar.


Multiple Operating Systems on One Hard Drive

Once you understand how to use manual partitioning, you can do whatever you want with it. For example, you can install a number of operating systems on one hard drive. You may have a partition for sharing files between operating systems, or backup.

To calculate partition size, determine swap size, then divide up the remaining space as desired.


Installing When Multiple Partitions Already Set Up

If you want to install more than one operating system on a computer, it is ideal to set up all partitions first, and select a different partition when installing each operating system.

When installing newer versions of Windows, you can select which partition to use.

Older versions of Windows will be installed on the partition you make active or boot.

A Linux operating system will be installed on the partition you select as /.


Two or More Hard Drives

A computer may have two or more hard drives, and these may be partitioned however you choose.


Grub Menu

If you want a menu to select which operating system you want to use each time you turn on the computer, Linux must be installed last. If Windows is installed last, you will not be able to access Linux, unless you edit the Grub menu, and set up the Master Boot Record.

A few Linux distributions may not create a menu. If you find one doesn't, install one that does last, or set up Grub manually.

A few Linux distributions use programs other than Grub for a start menu.


USB Drives

In the past, operating systems have mainly been installed on hard drives. It is now possible to install operating systems on USB drives.

USB drives may be partitioned in the same way as hard drives.

The BIOS in older computers cannot be set to start an operating system on a USB drive.

A computer uses a swap partition like extra RAM. If you install Linux on a USB drive, do not make a swap partition on the USB drive, as it will greatly shorten the life of the USB drive. If Linux is installed on the hard drive, it will have a swap partition and Linux will use it. If there is no swap partition, make one on the hard drive.


Live CDs for Partitioning

GParted and Parted Magic are live CDs for partitioning hard drives and USB drives. Those wanting to set up partitions before installing operating systems may download and use one of these. For more information, see Live CDs for Partitioning.


Erase Everything from a Hard Drive

DBAN can be used to completely erase everything from a hard drive. Nothing previously on the hard drive can be recovered after using DBAN.

Malware can usually be eliminated by reinstalling the operating system. On rare occasions, this does not remove malware. To be sure it is removed, use DBAN to erase everything from hard drive before reinstalling the operating system.

Formatting prevents something already on a hard drive causing problems during installation. On rare occasions, problems may occur because formatting does not remove everything. If an operating system won't install properly, this is one possible reason. This can be overcome by using DBAN to erase everything from the hard drive before installation.

On rare occasions, hard drives become unusable because of something on the hard drive, usually in the master boot record. This may occur as a result of a virus or malfunction. DBAN can be used to erase everything from the hard drive, and it will become usable again, after it has been partitioned and formatted. Be aware, if a hard drive has an electrical or mechanical fault, this will not fix it.

For more information, see Erase Everything from a Hard Drive.


< Filesystems

Live CDs for Partitioning >


© Copyright Guy Shipard 2008 - 2009