![]() |
The steps for creating swap space are similar to those for creating any other file system. One difference is the filesystem type under fdisk. We'll use the second partition on the drive above for our example. #fdisk /dev/hdb
The number of cylinders for this disk is set to 1653.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Disk /dev/hdb: 255 heads, 63 sectors, 1653 cylinders
Units = cylinders of 16065 * 512 bytes
/dev/hdb1 1 413 2441406 83 Linux
/dev/hdb2 414 827 2441406 83 Linux
/dev/hdb3 828 1240 2441406 83 Linux
/dev/hdb4 1241 1653 2441406 83 Linux
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
# fdisk -l /dev/hdb
Disk /dev/hdb: 255 heads, 63 sectors, 1653 cylinders
Units = cylinders of 16065 * 512 bytes
/dev/hdb1 1 413 2441406 83 Linux
/dev/hdb2 414 827 2441406 82 Linux swap
/dev/hdb3 828 1240 2441406 83 Linux
/dev/hdb4 1241 1653 2441406 83 Linux
# mkswap /dev/hdb
mkswap /dev/rd/c0d1p2
Setting up swapspace version 1, size = 2499999 kB
#