Installing Linux: Partitioning and File System Considerations

22
Installing Linux: Partitioning and File System Considerations Kevin O'Brien Washtenaw Linux Users Group http://www.lugwash.org

description

Looking at some key questions to consider when installing Linux for the first time

Transcript of Installing Linux: Partitioning and File System Considerations

Page 1: Installing Linux: Partitioning and File System Considerations

Installing Linux:Partitioning and File System

Considerations

Kevin O'BrienWashtenaw Linux Users Group

http://www.lugwash.org

Page 2: Installing Linux: Partitioning and File System Considerations

2

Where Will You Install?

● Single Linux system● Dual boot with Windows● Dual boot with other OS

Page 3: Installing Linux: Partitioning and File System Considerations

3

Single Linux System

● Simplest install with least worry● Hardware is cheap● Linux works well with older hardware, can

give new life to an older system

Page 4: Installing Linux: Partitioning and File System Considerations

4

Dual Boot With Windows

● Backup your data first!!!!● Safest approach is to add a second hard

drive● Can also re-partition existing drive (probably

required for laptops)● Must have Windows already installed before

installing Linux

Page 5: Installing Linux: Partitioning and File System Considerations

5

Dual Boot With Other OS

● Can install Linux with other OS, including other Linux distros

● With multiple Linux installs, you can install in any order, I believe.

● Can share data between installs if you like.● I still prefer separate hard drives for each OS

install

Page 6: Installing Linux: Partitioning and File System Considerations

6

If you want to re-partition

● Backup your data first!!!!● Most Linux distros include re-partitioning

software in the installation CD● Partition Magic <http://www.symantec.com/>● GNU Parted

<http://www.gnu.org/software/parted/index.shtml>

Page 7: Installing Linux: Partitioning and File System Considerations

7

Good Open-Source Solution

● GParted Live CDhttp://gparted.sourceforge.net/livecd.php

● Can also be installed on a USB drive: http://gparted.sourceforge.net/liveusb.php

Page 8: Installing Linux: Partitioning and File System Considerations

8

Linux File System Structure

● Typical directories:– /– /bin– /boot– /dev– /etc– /home/initrd– /lib– /lost+found

Page 9: Installing Linux: Partitioning and File System Considerations

9

Linux File System Structure (cont)

– /misc– /media– /opt– /proc– /root– /sbin– /tmp– /usr– /var

Page 10: Installing Linux: Partitioning and File System Considerations

10

How to allocate in partitions

● Every Linux install must have at least two partitions

● One must be a swap partition. This is generally set at 2x the amount of physical memory, but may be more for servers.

● Everything else can go into one data partition, but this is not the best solution in most cases

Page 11: Installing Linux: Partitioning and File System Considerations

11

Partitioning choice

● Putting all directories into one partition can cause problems– For servers, it is advisable to put /var into its own

partition. This directory holds the log files, and servers can generate a lot of data in log files. If these fill up, it can crash your server if everything is in one partition.

– It is a good idea to separate user data from the OS. I recommend putting the /home directory on its own partition.

Page 12: Installing Linux: Partitioning and File System Considerations

12

File System Choice

● Options include ext2, ext3, Reiser, fat32, jfs for data partitions. Swap is swap.

● Which one you choose depends on your needs, to some degree. For most people, it will come down to ext2, ext3, Reiser, or fat32.

● ext2 is the older standard for Linux. It is stable, but does not have journaling.

Page 13: Installing Linux: Partitioning and File System Considerations

13

File System Choice (cont)

● ext3 is the update to ext2 that adds journaling. Journaling is important for data integrity. A sudden crash (power outage?) can leave unwritten changes to data, but a journaling system will recover those changes. Backwards compatible with ext2

● Reiser is stable, and very fast. Whether it has a future is slightly unclear at this point. But if speed is your most important need, this is the one to use.

Page 14: Installing Linux: Partitioning and File System Considerations

14

File System Choice (cont)

● fat32 is not a native Linux file system, it is a Windows file system, introduced with Windows 95 OSR2. It is not the normal file system for Windows XP or Windows 2000, which would be NTFS. But is has one virtue, which is that is you are planning to dual boot Linux and Windows, and want to have full read-write access to the same data, fat32 is the answer. But only create a data partition for that data you want to share.

Page 15: Installing Linux: Partitioning and File System Considerations

15

Bottom line

● I cannot see why anyone would choose ext2 at this point. ext3 does everything ext2 does, and adds journaling.

● Reiser is a possibility if you have the need for speed, but will it survive his legal troubles?

● For most Linux installs, ext3 is a fine choice, and should be your default.

Page 16: Installing Linux: Partitioning and File System Considerations

16

Example: Linux single install

● Assume a hypothetical 200GB hard drive– Allow 2-3GB for the swap partition. Your install

routine will probably make a default choice based on your system configuration. Accept this. People who write install routines frequently know what they are doing.

– Set a second partition for / and everything not otherwise accounted for. Allow 50GB for this. Make it ext3

Page 17: Installing Linux: Partitioning and File System Considerations

17

Example: Linux Single Install (cont)

– If this is going to be a server, set a third partition for /var. Allow 30GB for this. Make it ext3.

– Allocate the rest of the drive to /home. This should be approximately 117GB in our example (or 147GB if there is no separate /var partition). All of your MP3 files, movies, documents, and so on go here. Make this one ext3 as well.

Page 18: Installing Linux: Partitioning and File System Considerations

18

Dual Boot with Windows

● Assume a system that already has Windows installed.

● Assume adding a 200GB second hard drive.– Allow 2-3GB for the swap partition.– Set a fat32 partition for shared data. Note that fat32

has some limitations, such as large cluster sizes, and maximum 4GB file size. For movies, that can be an issue. The size of this partition will be determined by what you want to share. In this example, 50GB

Page 19: Installing Linux: Partitioning and File System Considerations

19

Dual Boot with Windows (cont)

– Set a third partition for / and everything not otherwise accounted for. Allow 50GB for this. Make it ext3.

– Allocate the rest of the drive to /home. This should be approximately 97GB in our example.

Page 20: Installing Linux: Partitioning and File System Considerations

20

Dual Boot with Windows (cont)

– However, sizing the fat32 and the /home partition depends on how much of your data you intend to be Linux-only, and how much you want to share with Windows. If you want to share everything, do not create a separate partition for /home. Instead, let the install routine create a /home directory in the root partition along with everything else, and create a large fat32 directory with the rest of the space. Or perhaps create a couple of them.

Page 21: Installing Linux: Partitioning and File System Considerations

21

Multiple Linux Install

● Assume you have Linux already installed on a single hard drive.

● Assume you are adding a second hard drive of 200GB– You may need to have a second swap partition

for the second install. I have not yet found a definitive answer for this. It should not be a big deal. My own example of this uses separate swap partitions for each install

Page 22: Installing Linux: Partitioning and File System Considerations

22

Multiple Linux Install (cont)

– Configure the rest of the install as if it were a single Linux install.

– Sharing data: I am not sure what the best way is to handle this. You might be able to create a single /home directory to do this, though I have not done it. Any ideas?