Making a swap partition in Linux
I have just made an backup of my old data in NTFS partition in my laptop. So, it is a good time to format that partition into ext3. In my case, the partition is a logical partition inside Win95 extended partition (f or W95 Ext'd (LBA)) while itself is NTFS (8 or HPFS/NTFS). In summary, my partition table is as follow.
/dev/hda1 Linux
/dev/hda2 W95 Ext'd (LBA)
/dev/hda5 HPFS/NTFS
/dev/hda6 Linux swap / Solaris
At the end of this transformation, I expect to have as below.
/dev/hda1 Linux
/dev/hda2 Linux extended
/dev/hda5 Linux
/dev/hda6 Linux swap / Solaris
Below is my instructions.
-
Deactivate the swap
swapoff -a
-
Delete /dev/hda2
- Add /dev/hda2 as Linux extended
- Add /dev/hda5
- Add /dev/hda6
- Change partition type of /dev/hda6 to 82 or Linux swap / Solaris
- Write the partition
- Reboot to take effect
-
Format /dev/hda5 to ext3
mkfs.ext3 /dev/hda5
-
Format /dev/hda6 to Linux swap
mkswap /dev/hda6
-
Activate the swap partition
swapon -a
-
Mount /dev/hda5 on boot by adding below line to
/etc/fstab
/dev/hda5 /media/data ext3 defaults,errors=remount-ro 0 1
-
Mount that partition
mount -a
You might try to reboot again to make sure everything works just fine.
- sugree's blog
- 523 reads
Post new comment