Penguin
Blame: PartitioningSuggestions
EditPageHistoryDiffInfoLikePages
Annotated edit history of PartitioningSuggestions version 12, including all changes. View license author blame.
Rev Author # Line
12 IanMcDonald 1 If you a looking for a tool to modify [Partition]~s of a drive that is already in use (and you don't want to lose the data on the partitions), you could use the proprietary (but very good) ~PartitionMagic, the [Free] tool parted(8) or [GParted | http://gparted.sourceforge.net/] which is available as a live CD which reduces the risks from running an OperatingSystem at the same time as partitioning.
2
3 If you want to reduce the size of a Windows partition, it is worthwhile running scandisk and defrag from within Windows, and backing up all your data, before resizing the [Partition].
4
6 PeterHewett 5 A modern distro with a fairly full desktop install will take around 2 to 3 GB of disk space. Allow some room for your /home files, and you will need to free up at least 5GB for the Linux partition.
1 AristotlePagaltzis 6
7 For a thorough explanation of partitioning, read the [Linux Partition HOWTO | http://www.tldp.org/HOWTO/Partition/].
7 CraigBox 8
9 A modern Linux distribution such as [Ubuntu] Hoary or [Mandriva] should let you do partition resizing in the installer.
1 AristotlePagaltzis 10
5 PeterHewett 11 You may also want to read a [mini howto on swap | http://www.xenotime.net/linux/doc/swap-mini-howto.txt] someone wrote.
1 AristotlePagaltzis 12
13 ----
6 PeterHewett 14 !! Simplest Setup
15 You can set up [Partition]~s as complicated or as simple as you like. The simplest setup is a swap partition (size as twice your RAM up to about 1GB) and the rest of the drive as a single partition mounted on / .
5 PeterHewett 16
17 ----
6 PeterHewett 18 !! Dual Boot Suggestions
19 When trying out Linux, most people run dual boot so they can continue to use their Windows system. A basic partitioning scheme for a 40GB hard disk might look like this.
5 PeterHewett 20
6 PeterHewett 21 <?plugin OldStyleTable
22 |*Partition*|*Type*|*Size*|*Linux Mount Point*
23 |hda1|ntfs|30GB|/mnt/Windows
24 |hda5|ext3|7GB| /
25 |hda6|swap|500MB|swap
26 ?>
1 AristotlePagaltzis 27
6 PeterHewett 28 If you are using dual boot, you may want to move files between Linux and Windows. However, Linux cannot write to ntfs and Windows cannot read or write to the Linux partitions. A solution is a FAT partition, which both systems can read and write to. This example is for a 60GB hard disk. Windows will see the FAT partition as drive e: or f: or similar.
29
30 <?plugin OldStyleTable
31 |*Partition*|*Type*|*Size*|*Linux Mount Point*
32 |hda1|ntfs|40GB|/mnt/Windows
33 |hda5|ext3|10GB| /
34 |hda6|swap|500MB|swap
8 DanielLawson 35 |hda7|vfat|6GB|/mnt/fat
6 PeterHewett 36 ?>
37
38
39 ----
40 !! Multiple Partition Example
41 Setting up additional partitions can provide worthwhile benefits in some cases.
42
43 ! hda1: /boot (32-64MB)
1 AristotlePagaltzis 44
45 Historically [LILO] could not read past 1024 cylinders, so people created their first or second partition as <tt>/boot</tt>.
46 While this limitation has been lifted, a separate <tt>/boot</tt> is still a good idea.
47 It lets you to mount your <tt>/boot</tt> as read-only, which protects your all-important [Kernel] from being accidentally blown away by careless fingers.
48 It also lets you stick to using [Ext2] for <tt>/boot</tt> while using [Ext3] or some other more advanced FileSystem on your root partition.
49
6 PeterHewett 50 ! hda2: swap (128-256MB)
1 AristotlePagaltzis 51
52 Older [Linux] [Kernel]s could not use more than 128[MB] of swap in a single partition.
53 New kernels do not have this limitation, but you shouldn't have more than about 256MB of swap (128MB is probably enough really).
54 If you find yourself running into swap a lot you should buy more RAM.
11 LawrenceDoliveiro 55 Swap is not a substitute for RAM, it is a safety zone so that your system doesn't run out of [RAM] and trigger the dreaded OomKiller.
1 AristotlePagaltzis 56 It is also used as a place to swap out rarely used chunks of [RAM] (ie all those getty(8)s you still have running while you're in X).
57
6 PeterHewett 58 ! hda3: / (1-4GB)
1 AristotlePagaltzis 59
60 The root partition, which is where everything gets chucked on a workstation.
61 The biggest area of your root partition will be <tt>/usr</tt> or <tt>/opt</tt>.
62 How big you make this partition all depends on what apps and packages you will be installing.
63
6 PeterHewett 64 ! hda4
1 AristotlePagaltzis 65
66 The [PC] [BIOS] only supports 4 primary partions, so your 4th primary becomes an extended partion which covers the entire remaining portion of your disk.
67
6 PeterHewett 68 ! hda5: /usr/local (1-2GB)
1 AristotlePagaltzis 69
70 This is where you can build and install [Package]s from source TarBall~s.
71 Everything outside of <tt>/usr/local</tt> should be managed by PackageManagement.
72
6 PeterHewett 73 ! hda6: /home (the rest of the drive)
1 AristotlePagaltzis 74
75 All your user accounts, warez, pr0n, mp3s etc. :)
76
6 PeterHewett 77 This is a good layout for a personal workstation as it ensures that all your user data is on another partition safe from OperatingSystem upgades.
78 ----
79 Servers on the other hand should have a slightly different layout. Generally they also have the following partitions:
1 AristotlePagaltzis 80
6 PeterHewett 81 ! /tmp, /var/tmp (256-512MB, maybe more)
1 AristotlePagaltzis 82
83 Make sure these partitions are large enough, but don't waste too much space on them.
84 Having a separate partition for them is good, because the turnover of files is very fast, which leads to fragmentation.
85 It also helps, because they are problematic since everyone can write there.
86 A separate partition ensures that people cannot overflow important partitions by filling the temp space with crud.
87 It also allows using separate mount(8) options such as <tt>noexec</tt> and <tt>nosuid</tt> which prevent people from creating executable files.
88 Be careful.
89
6 PeterHewett 90 ! /var (512MB-1GB)
1 AristotlePagaltzis 91
92 This is the variable data area is where logs and other files important for system auditing and monitoring are stored.
93 __Make sure this partition is large enough__ so there is always enough space on <tt>/var</tt> for your log files to continue being written to.
94 Take as many steps as possible to protect these files: areas like <tt>/var/spool</tt> or <tt>/var/imap</tt> should have their modes/attributes changed to try and ensure there is no data lost on server failures.
95 Investigate the <tt>sync</tt> mount option and the chattr(1) command.
96
6 PeterHewett 97 ! /usr (whatever your feel is adaquate/sufficient for your situation)
1 AristotlePagaltzis 98
99 To add additional protection to your applications from system crackers you can mount your <tt>/usr</tt> partition readonly.
9 DanielLawson 100
101 ----
102 !! Mounting partitions
103
104 There are a number of ways you can address partitions within linux. You can either use the raw device name, eg /dev/sda1, or you have the option of setting a label on the partition, or using the partition's [UUID].
105
106 In most cases the raw device name will do, but there are some situations in which this is less than optimal. The SCSI/SATA layer, for example, creates devices in the order they are detected, with an incrementing device name /dev/sda, /dev/sdb etc. If devices are reordered they will get a different device name. Devices might be reordered due to controller changes or scan order changes - IDE will suffer the same problem here - or they might change due to a device disappearing (for example, if you remove a faulty disk from a RAID set).
107
108 Another situation in which this can occur is if you use external storage devices, such as flash disks, external harddrives or digital cameras. If you don't plug them in in the right order, they'll end up with different device names. This is ok if you do all your mounts manually, but if you want to use fstab to remember things then this just won't work.
109
110 Disk labels provide one way of abstracting the partitions away, however they cannot be guaranteed to be unique for a system. Consider what might happen if you have a system installed using labels, with labels like ROOT, VAR, USR etc, and then you put another disk into your machine with the same labels. Which ones get mounted? This isn't such a contrived example - some linux distributions will label partitions for you, eg RedHat.
111
10 DanielLawson 112 The partition [UUID] is guaranteed to be universally unique, and will always point to the same partition. [UUID]s are supported on all (AddToMe: check this) filesystems linux supports, including swap and vfat.
9 DanielLawson 113
114 To find out the [UUID] of an existing partition, use the blkid program that comes with e2fsprogs.
115
116 To specify a [UUID] or a label in your /etc/fstab, replace the device name (eg, /dev/sda1) with UUID=..... or LABEL=....
117
118 Another option for persistent mount points is to use udev to match on some other criteria, eg a USB serial ID for a particular external enclosure. This makes sense if you change the physical drive in the enclosure but still want it to mount to the same place
1 AristotlePagaltzis 119
120 ----
121 CategoryDiskNotes

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()