Fixed the problem of not sleeping after SWAP formatting in Ubuntu.

Source: Internet
Author: User
Article Title: fixed the problem of non-sleep after SWAP formatting on Ubuntu. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic classification Ubuntu presets use UUID to identify different partitions. Formatting the swap partition will produce a new UUID, so that Ubuntu cannot find the swap partition. Because the system hibernate needs to store the system status in the swap partition. If it is not found, the swap partition will cause sleep and reply failure. Therefore, we need to tell the new UUID of the Ubuntu swap partition to modify the sleep function.
 
Use blkid to find the new UUID of the swap partition:
 
# Blkid
 
/Dev/sda1: TYPE = "ntfs"
 
/Dev/sda2: UUID = "b8a89b69-f090-4012-94f6-a243014d1184" SEC_TYPE = "ext2" TYPE = "ext3 ″
 
/Dev/sda5: LABEL = "SwapSpace" UUID = "62a19d18-5c43-4df8-9df0-701_bf7dc5d" TYPE = "swap"
 
/Dev/sda6: UUID = "6357e627-dea6-418f-8735-14ddc377ff66" SEC_TYPE = "ext2" TYPE = "ext3 ″
 
/Dev/sda7: UUID = "02c44f5b-d41e-42d3-9dfa-9517be310d3f" SEC_TYPE = "ext2" TYPE = "ext3 ″
 
/Dev/sda8: UUID = "0a22b594-f2ce-4183-8aa3-ea3a7b9a371d" SEC_TYPE = "ext2" TYPE = "ext3 ″
 
/Dev/sda9: LABEL = "/" UUID = "bc101f56-e391-4022-b280-d29eb7cf76a5" SEC_TYPE = "ext2" TYPE = "ext3 ″
 
Now we can know that the UUID of the Swap partition is "62a19d18-5c43-4df8-9df0-701_bf7dc5d 」. First, correct the Swap partition location in/etc/fstab:
 
#/Dev/sda5
 
# UUID = e5113b30-3c4c-4ddc-9c14-e4ecd0374886 none swap sw 0 0
 
UUID = 62a19d18-5c43-4df8-9df0-70108bf7dc5d none swap sw 0 0
 
Next, you need to change the partition UUID of the sleep reply. First, modify the UUID on/etc/initramfs-tools/conf. d/resume:
 
RESUME = UUID = 62a19d18-5c43-4df8-9df0-70108bf7dc5d
 
Click "update-initramfs-u" to create the initrd file.
 

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.