drive partions

Thoughts on setting up Ubuntu partitions.

/ – 30 G
/boot – 300 Megs – this just for kernel
/swap – 16 G
/home – 40 G (if you’re not going to have more than one Linux user, make it smaller)
/www – 20G or more – for http server
/usr – 20 G – for applications
/var – 20 G – for logs and database stuff

if you have more space left, distribute it evenly
The reason for splitting up partitions is for 1) if they get corrupted you don’t loose all your data 2) if you want to mount them from other systems, it’ll be easier 3) the main reason is that if they become full, they will not bring your whole system down.

You do not create partition for every Linux directory. The basic concept of partition is to keep data safe and tidy in their respective space. Normally, Linux partitions that need to be assigned their own partitions are:


The / partition are mandatory and the /swap partition are recommended. Other mount points depend on what the end system would be (what type of Linux server it is). So for the /swap and / partition type, you should choose Primary. If you are planning to create partitions for all directories above, choose logical for the third partition. That’s the basic idea.


This fs contains spool directories such as those for mail and printing.
In addition, it contains the error log directory. If your machine is a server and develops a chronic error, those msgs can fill the partition.
Server computers ought to have /var in a different partition than /.


This is where most executable binaries go. In addition, the kernel source tree goes here, and much documentation.


Some programs write temporary data files here. Usually, they are quite small. However, if you run computationally intensive jobs, like science or engineering applications, hundreds of megabytes could be required for brief periods of time. In this case, keep /tmp in a different partition than /.


This is where users home directories go. If you do not impose quotas on your users, this ought to be in its own partition.


This is where your kernel images go.

Making a grub boot menu item and running gparted from it;

There is a restore partition command?





Setting up a raid 1 on Ubuntu 10.04

Start by following the Ubuntu ‘how to’ here;
When you get to step 8, do what they say, but then DONT select finish.’ follow the steps below;
At this point, you just have each drive set up and the raid set up, but the drives do not have a mount point, or a swap.
To fix this, on the partitions list, chose raid #1 (it will be the largest drive). At the next screen, select ‘use as’ and set it up as EXT3 or EXT4, then make it / as the mount point.
Select done.
Next select the raid #2. (The smaller/smallest drive). Set it to be EXT3 or EXT4 (make sure it matches the same as you set the first drive), then set it to be used as SWAP SPACE.
Now you really are done and can write the changes to disk and install the system.
This image shows how it should end up; Ubuntu raid 1 end result

Another walk through;

watch -n1 cat /proc/mdstat is great to watch the status of the raid

sudo mdadm -D /dev/md0 to check the status of the raid (hint, do a mount to check the device before doing this command)
sudo mdadm -E /dev/sda1 to check the status of just one of the disks in the array.
sudo mdadm –remove /dev/md0 /dev/sda1 to remove one of the disks from the array.
sudo mdadm –add /dev/md0 /dev/sda1 to add a disk to the array.

If you do need to replace a faulty drive, after the drive has been replaced and synced, grub will need to be installed. To install grub on the new drive, enter the following:

sudo grub-install /dev/md0

Replace /dev/md0 with the appropriate array device name.

Leave a comment