1. Create a partition (/dev/vdb4 in my case) using either fdisk or parted
2. Modify the parition type of this one to Hex code 82
3. Then Make sure the partition table of the disk is saved.
4. Once above is done, then run following commands as shown below:
[root@client1 ~]# free -m total used free shared buffers cached Mem: 996 264 732 0 19 118 -/+ buffers/cache: 125 871 Swap: 0 0 0 [root@client1 ~]# blkid -c /dev/null /dev/vda1: UUID="ebf8bf59-fd61-45fd-93f8-c55214f2948f" TYPE="ext4" /dev/vda2: UUID="ud5dLg-RYz6-WNMO-fj4W-5Z1e-KiHP-jGIk4r" TYPE="LVM2_member" /dev/vdb1: UUID="37846ba4-2434-4cdc-b322-b7aa28854bfc" TYPE="ext2" /dev/vdb2: UUID="162b6c2d-9ace-47b2-a7ba-b14abdf95bf4" TYPE="ext3" /dev/vdb3: UUID="88e9c86d-d7ab-47cc-9746-3eec78e698e0" TYPE="ext4" /dev/mapper/vg_client1-lv_root: UUID="5bf41004-9bd6-45ea-8880-eb0472fd134a" TYPE="ext4" /dev/mapper/vg_client1-lv_swap: UUID="3fd6f62f-3538-4e1a-85a3-231771121cad" TYPE="swap" [root@client1 ~]# which mkswap /sbin/mkswap [root@client1 ~]# mkswap -help Usage: mkswap [-c] [-pPAGESZ] [-L label] [-U UUID] /dev/name [blocks] [root@client1 ~]# mkswap /dev/vdb4 Setting up swapspace version 1, size = 352796 KiB no label, UUID=da1f8f91-45c7-4bef-a47c-c5d1a0a4d081 [root@client1 ~]# blkid -c /dev/null /dev/vda1: UUID="ebf8bf59-fd61-45fd-93f8-c55214f2948f" TYPE="ext4" /dev/vda2: UUID="ud5dLg-RYz6-WNMO-fj4W-5Z1e-KiHP-jGIk4r" TYPE="LVM2_member" /dev/vdb1: UUID="37846ba4-2434-4cdc-b322-b7aa28854bfc" TYPE="ext2" /dev/vdb2: UUID="162b6c2d-9ace-47b2-a7ba-b14abdf95bf4" TYPE="ext3" /dev/vdb3: UUID="88e9c86d-d7ab-47cc-9746-3eec78e698e0" TYPE="ext4" /dev/vdb4: UUID="da1f8f91-45c7-4bef-a47c-c5d1a0a4d081" TYPE="swap" /dev/mapper/vg_client1-lv_root: UUID="5bf41004-9bd6-45ea-8880-eb0472fd134a" TYPE="ext4" /dev/mapper/vg_client1-lv_swap: UUID="3fd6f62f-3538-4e1a-85a3-231771121cad" TYPE="swap" [root@client1 ~]# swapon -s Filename Type Size Used Priority [root@client1 ~]# swapon -a [root@client1 ~]# swapon -s Filename Type Size Used Priority /dev/vdb4 partition 352792 0 -1 [root@client1 ~]# free -m total used free shared buffers cached Mem: 996 264 732 0 20 118 -/+ buffers/cache: 125 871 Swap: 344 0 344Lastly, dont forget to make an entry of this newly created swap partition in /etc/fstab file (so that it remains in effect even after reboot).
[root@client1 ~]# vi /etc/fstab : : /dev/vdb4 swap swap defaults 0 0 : :
No comments:
Post a Comment