FedoraForum.org - Fedora Support Forums and Community
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2013
    Location
    Hong Kong
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    add back swap volume

    I have 2 linux and previously share a swap volume before upgrading to Fedora 20.
    During upgrade to Fedora 20 I did not remove the common shared swap volume to specify /swap and now ended up having Fedora 20 without swap volume mounted.

    Here is my fdisk. sda6 is the linux swap.
    Code:
    Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x851175d8
    
    Device    Boot     Start       End    Blocks  Id System
    /dev/sda1           2048   2459647   1228800   7 HPFS/NTFS/exFAT
    /dev/sda2        2459648 663092511 330316432   7 HPFS/NTFS/exFAT
    /dev/sda3      944003072 976771071  16384000   7 HPFS/NTFS/exFAT
    /dev/sda4      663093248 944003071 140454912   5 Extended
    /dev/sda5      785973248 935797466  74912109+ 83 Linux
    /dev/sda6      935798784 944003071   4102144  82 Linux swap / Solaris
    /dev/sda7 *    663097344 664121343    512000  83 Linux
    /dev/sda8      664123392 777803775  56840192  8e Linux LVM
    
    Partition table entries are not in disk order.
    
    Disk /dev/mapper/fedora-root: 36.4 GiB, 39107690496 bytes, 76382208 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    Disk /dev/mapper/fedora-home: 17.8 GiB, 19092471808 bytes, 37289984 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    From documentation it appears that I could edit /etc/fstab to mount swap at boot time. But I don't know the details.

    Here is my Fedora /etc/fstab

    Code:
    #
    # /etc/fstab
    # Created by anaconda on Tue Dec 24 16:16:21 2013
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/fedora-root /                       ext4    defaults        1 1
    UUID=9ffb98ea-21de-4216-ba05-a6d884c20d99 /boot                   ext4    defaults        1 2
    /dev/mapper/fedora-home /home                   ext4    defaults        1 2
    Here is my openSUSE /etc/fstab
    Code:
    /dev/disk/by-id/ata-TOSHIBA_MK5061GSY_51BMP049T-part6 swap                 swap       defaults              0 0
    /dev/disk/by-id/ata-TOSHIBA_MK5061GSY_51BMP049T-part5 /                    ext4       acl,user_xattr        1 1

    Appreciate help in adding back swap for Fedora 20. Thank you.

  2. #2
    Join Date
    Aug 2011
    Posts
    899
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: add back swap volume

    From what I saw with F19, systemd mounted my swap partition automatically without even an entry in /etc/fstab; actually to disable swap I had to explicitly mask the service that mounted it.

    Could you check the output of 'swapon -s'?

  3. #3
    Join Date
    Aug 2009
    Posts
    11,390
    Mentioned
    98 Post(s)
    Tagged
    0 Thread(s)

    Re: add back swap volume

    I believe that systemd only mounts the swap if it is on a GPT partitioned drive, and picks up the swap by the GPT partition type. On a MBR partitioned disk (like the OP has) it doesn't pick up the swap and mount it automatically.

    run blkid to find the UUID of your swap (/dev/sda6)

    Code:
    blkid
    It should give you output for all of your partitions, but you will be looking for something like this:

    Code:
    /dev/sda6: UUID="9b56d8f6-04ae-48c4-b2d7-1de21318620c" TYPE="swap" PARTUUID="00045886-03"
    Copy that UUID and create a linie in your /etc/fstab to mount your swap

    Note... The last line is my swap that corresoponds to the UUID from the blkid command above:

    Code:
    #
    # /etc/fstab
    # Created by anaconda on Mon Jan 28 23:27:32 2013
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=0f8d71c5-47ee-43be-816f-a50b7e16472e /                       ext4    defaults,relatime			1 1
    UUID=0354b6f9-8470-449f-8597-1d164e1bc473 /boot                   ext4    defaults,relatime			1 2
    UUID=5c30301d-f629-4f3c-8ce8-e731e93317da /home                   ext4    defaults,relatime			1 2
    UUID=9b56d8f6-04ae-48c4-b2d7-1de21318620c swap                    swap    defaults			        0 0

  4. #4
    Join Date
    Aug 2011
    Posts
    899
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: add back swap volume

    Quote Originally Posted by DBelton
    I believe that systemd only mounts the swap if it is on a GPT partitioned drive, and picks up the swap by the GPT partition type. On a MBR partitioned disk (like the OP has) it doesn't pick up the swap and mount it automatically.
    That indeed could explain the behaviour I saw; I don't recall exactly when it started happening but I do have a GPT partitioned HDD.

  5. #5
    Join Date
    Aug 2009
    Posts
    11,390
    Mentioned
    98 Post(s)
    Tagged
    0 Thread(s)

    Re: add back swap volume

    You probably noticed it when systemd started mounting it automatically, even if there was an entry in /etc/fstab and it gave an error during boot when it tried to mount the swap twice. It is supposed to not mount a swap automatically if there is an entry in /etc/fstab for it, but there was a a bug.

  6. #6
    Join Date
    Nov 2013
    Location
    Hong Kong
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: add back swap volume

    I have added below line to /etc/fstab and now I have swap mounted auto during boot. It was not available before I add the line.
    I used gparted to check instead of using 'swapon -s'

    Code:
    UUID=7974284b-b1a8-4ee4-9e0b-ca41dfa1263a none   swap    sw      0       0
    
    
    [Andy@localhost ~]$ swapon -s
    Filename				Type		Size	Used	Priority
    /dev/sda6                              	partition	4102140	0	-1
    Thank you all and

    MERRY CHRISTMAS !

Similar Threads

  1. swap logical volume vs. a non-LVM2 swap
    By jenaniston in forum Using Fedora
    Replies: 10
    Last Post: 22nd January 2013, 12:47 AM
  2. How to add more SWAP
    By argo24 in forum Using Fedora
    Replies: 8
    Last Post: 6th November 2012, 03:36 AM
  3. need to add swap partition
    By .:neogeo:. in forum Installation, Upgrades and Live Media
    Replies: 4
    Last Post: 15th January 2008, 01:02 AM
  4. Add More Swap space??
    By LouArnold in forum Using Fedora
    Replies: 5
    Last Post: 19th July 2006, 08:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •