Azure Linux VM Swap partition

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.