Comment 1 for bug 1374166

Revision history for this message
Cracco (daniele-cozzo) wrote :

Hi,

these are the steps I've used to add a swap partition to my Ubuntu VM on Azure:

1) Add from Azure portal a new data disk (in my case I added 2 data disk, the first is a 100 GB disk, the second one is a 6GB size for swap partition)

“/dev/sda” is the Azure VM OS disk;
“/dev/sdb” is the Azure VM local temporary disk;
“/dev/sdc” is the first Azure VM added data disk (100GB);
“/dev/sdd” is the second Azure VM added data disk (6GB);

2) create a new swap partition on /dev/sdd. Use cfdisk as follows:
# cfdisk /dev/sdd

partition type: Primary
FS type: Linux swap / Solaris (id 82)

3) mount swap partition on boot.
# nano /etc/fstab

append the following line and save the file:
/dev/sdd1 none swap sw 0 0

4) reboot the VM

5) create the swap partition. Use the following commands:
# mkswap /dev/sdd1
# swapon /dev/sdd1

6) verify if partition has been successfully created:
# cat /proc/swaps

Hope this helps,
Cracco