By default, Linux VMS on Windows Azure are not swap-partitioned. Let's take Ubuntu, for example, to create a swap partition for a Linux virtual machine on Windows Azure.
Windows Azure assigns a temporary disk to each virtual machine, which is the [D:] Disk in the Windows Server operating system and is/DEV/SDB1 in Linux. It is worth mentioning that, in the D-series of virtual machines, the temporary disk is SSD storage. Obviously, a temporary disk is a good place to create a swap partition. Since it is a temporary disk, do not put the application and data stored on the above , otherwise the data lost can only cry.
View the mount location of the/DEV/SDB1
Lsblk
Suppose the mount point to find the/DEV/SDB1 is/mnt
Create a Swap partition file
sudo fallocate-l [swap file size, for example: 5g] [swap file full path, for example:/mnt/myswapfile]
Modify swap file permissions
sudo chmod [swap file full path]
Create swap file system
sudo mkswap [swap file full path]
Enable swap partition
sudo swapon [swap file full path]
Next, you can see the swap partition by executing the [free] command.
So far, the swap partition has been created, but after the reboot, it is found that the Linux system still does not have a swap partition! It doesn't matter, just modify the fstab can be done.
0 0
Azure Linux VM Swap partition