Linux Supplemental Mount swap partition

Source: Internet
Author: User
Tags uuid

Linux Supplemental Mount swap partition

Computer room of a new cento,top found no swap partition, it appears that the computer room initial installation system has problems.

[Email protected] ~]# toptop-18:26:53 up 3:41, 2 users, load average:0.00, 0.01, 0.05tasks:213 Total, 1 running,  212 sleeping, 0 stopped, 0 zombiecpu (s): 0.0%us, 0.0%sy, 0.0%ni, 99.9%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%stmem:    16324896k Total, 259328k used, 16065568k free, 5984k buffersswap:0k total, 0k used, 0k free, 26932k Cached


As you can see, Swap is 0k

View the server system disk partition:

[[Email protected] ~]# parted /dev/sdagnu parted 2.1using /dev/sdawelcome  to GNU Parted! Type  ' Help '  to view a list of commands. (parted)  p                                                                   Model: ATA  st33000650ns  (SCSI) disk /dev/sda: 3001gbsector size  (logical/physical):  512B/ 512bpartition table: gptnumber  start   end      size    file system  name  flags 1       1049kb  316mb   315mb   ext4 2      316mb    4510mb  4194mb                      raid 3      4510MB   3001gb  2996gb  ext4

Replace a server that is just installed compare:

[[Email protected] ~]# parted /dev/sdagnu parted 2.1using /dev/sdawelcome  to GNU Parted! Type  ' Help '  to view a list of commands. (parted)  p                                                                   Model: ATA  st33000650ns  (SCSI) disk /dev/sda: 3001gbsector size  (logical/physical):  512B/ 512bpartition table: gptnumber  start   end      size    file system     name  flags 1       1049kb  106mb   105mb   ext4 2      106mb    8495mb  8389mb  linux-swap (v1)  3       8495mb  3001gb  2992gb  ext


It appears that the second partition is not partitioned, and the partition is mounted to try

[[Email protected] ~]# mkswap /dev/sda2setting up swapspace version 1,  size = 4095996 kibno label, uuid=d713cc10-10dc-42d0-b152-c6eecbcd6579#uuid= d713cc10-10dc-42d0-b152-c6eecbcd6579[[email protected] ~]# swapon /dev/sda2[[email  protected] ~]# toptop - 18:35:24 up  3:49,  2 users,   load average: 0.00, 0.01, 0.05Tasks: 212 total,   1  RUNNING, 211 SLEEPING,   0 STOPPED,   0 ZOMBIECPU (s):   0.0%us,  0.1%sy,  0.0%ni, 98.5%id,  1.3%wa,  0.0%hi,   0.0%si,  0.0%stMem:  16324896k total,   262768k used,  16062128k free,     6100k buffersswap:  4095996k total,     &nbSp;   0k used,  4095996k free,    27000k cached 


It worked,swap:4095996k total.

Finally put in the/etc/fstab, make sure to use it properly after reboot

[[email protected] ~]# cat /etc/fstab uuid=356d4065-9613-490e-a22f-f7c1a7b85d84  /                        ext4    defaults         1 1UUID=cb053b9d-9ef8-48e3-8227-683c62d937f6 /boot                    ext4    defaults         1 2uuid=d713cc10-10dc-42d0-b152-c6eecbcd6579 swap                      swap    defaults        0 0tmpfs                     /dev/shm                tmpfs    defaults        0 0devpts                   /dev/pts                 devpts  gid=5,mode=620   0 0sysfs                    /sys                     sysfs   defaults         0 0proc                     /proc                    proc    defaults        0  0label=/data2 /data2 ext4 defaults 0 0



This article is from "Fuzhou Hengda computer" blog, please be sure to keep this source http://fzhddn.blog.51cto.com/12650899/1917073

Linux Supplemental Mount swap partition

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.