Tuesday, December 16, 2008

Configuring the fstab

== Configuring the fstab ==

In this sample how to add a swap partition on to fstab. The Swap partition is located on sda2.

* If fresh formatted partition for swap and not yet mounted do the following:

fdisk -l (to list out the devices)
mkswap /dev/sda2 (to set the sda2 swap)

* To locate the uuid of sda2
cd /dev/disk/by-uuid
ls - l

it should display like this example:
lrwxrwxrwx 1 root root 10 2008-10-30 12:26 f0306cfc-2bb7-4f51-afc5-c28e56c5416f -> ../../sda1
lrwxrwxrwx 1 root root 10 2008-10-30 12:26 f35a5a72-8034-42f4-85f9-44d0e27a7439 -> ../../sda2

* then add the colored blue text to the fstab sample below

UUID=f0306cfc-2bb7-4f51-afc5-c28e56c5416f / ext3 relatime,errors=remount-ro 0 1
UUID= f35a5a72-8034-42f4-85f9-44d0e27a7439 none swap 0 0


* to mount it without rebooting just type this command:
mount -a

No comments: