Here’s my personal preference for an allround Linux box. The following volume layout is a baseline. If the machine is a server reduce /home and add much more to /var where normally you data lives. For a development box increase /home for all your projects.
I use the lvm2 package, so these commands use the most common options.
First harddrive
Prepare the disk with fdisk /dev/sda
- Use fdisk /dev/sda to partion your first drive
- /dev/sda1 > /boot ext3, 256MB
- /dev/sda2 > Linux LVM (8e), rest of the drive
- pvcreate /dev/sda2 # create the physical volume
- vgcreate vg0 /dev/sda # create one volume group for the system volumes
- lvcreate -L 2G - n root vg0 # format as ext3 and mount on /
- lvcreate -L <depending on memory and disksize> -n swap vg0 # use as swaparea
- lvcreate -L 2G -n usr vg0 # format as ext3 mount on /usr
- lvcreate -L 512M -n tmp -vg0 # format as ext3, mount on /tmp
- lvcreate -L <512M - 2G> -n home vg0 # format as ext3, mount on /home
- lvcreate -L 256M -n opt vg0 # format as ext3, mount on /opt
- lvcreate -L 512M -n usrlocal vg0 # format as ext3, mount on /usrlocal
- lvcreate -L <1G - nG> -n var vg0 # format as ext3, mount on /var
Additional harddisks
When you install / assign more than one drive you can must create a LVM partiton with fdisk and then you can extend the physical volume. It’s up to you to extend the volume group too or create a second vg. In case of extenting the first vg you can extent the logical volume where the space is needed. If you have installed an application you can also dedicate a logical volume to that application and mount it where approbiate.