Results 1 to 5 of 5

Thread: Changed swap partition size

  1. #1
    Join Date
    May 2008
    Beans
    8
    Distro
    Ubuntu 8.04 Hardy Heron

    Changed swap partition size [Resolved]

    Hey,

    I have discovered I've made a bad move, as mentioned in the title, I increased the swap partition size (because it was ridiculously low), now Ubuntu 8.04 doesn't recognise it when I go to hibernate, etc

    Is there a way I can assign the swap partition to ubuntu again, without reinstalling?

    Thanks in advance
    Last edited by timace; May 15th, 2008 at 07:55 AM. Reason: Resolved

  2. #2
    Join Date
    Feb 2007
    Beans
    24,961
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Changed swap partition size

    Quote Originally Posted by timace View Post
    Hey,

    I have discovered I've made a bad move, as mentioned in the title, I increased the swap partition size (because it was ridiculously low), now Ubuntu 8.04 doesn't recognise it when I go to hibernate, etc

    Is there a way I can assign the swap partition to ubuntu again, without reinstalling?

    Thanks in advance
    HI and this link can help to activate your swap
    https://help.ubuntu.com/community/SwapFaq

  3. #3
    Join Date
    Jan 2008
    Location
    /dev/null
    Beans
    2,793
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Changed swap partition size

    Quote Originally Posted by timace View Post
    Hey,

    I have discovered I've made a bad move, as mentioned in the title, I increased the swap partition size (because it was ridiculously low), now Ubuntu 8.04 doesn't recognise it when I go to hibernate, etc

    Is there a way I can assign the swap partition to ubuntu again, without reinstalling?

    Thanks in advance
    change your fstab to match the current partition information. you can do this by changing the UUID to match the new uuid of the swap partition (the UUID changed when you resized it) or simply change the /etc/fstab to load the swap partition via /dev or label. (you need superuser priveledges to save the changes)

    Code:
    sudo nano /etc/fstab
    for example example if your swap resided on sdb2 the line should look like this:
    Code:
    /dev/sdb2	 none            swap    sw              0       0
    If you want to go the UUID route:

    Code:
    ls -alh /dev/disk/by-uuid
    then modify the UUID for your swap partition in /etc/fstab


    edit: additional information as prompted by overdrank's response above:

    after doing the above:
    Code:
    sudo mount -a
    swapon -a
    to verify your swap file is mounted and working:
    Code:
    free -m
    if you see any value for swap other than:
    Code:
    Swap:            0          0          0
    you are good to go
    Last edited by Oldsoldier2003; May 14th, 2008 at 11:47 PM.

  4. #4
    Join Date
    Jun 2006
    Location
    Texas
    Beans
    3,930
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Changed swap partition size

    Been there, done that. To fix hibernation the UUID for swap needs to be checked in 2 places.
    /etc/fstab and /etc/initramfs-tools/conf.d/resume

    If the UUID changed then you need to run
    Code:
    sudo dpkg-reconfigure  initramfs-tools
    http://louboldt.com/ilinuxmisc.htm#uuidswap
    UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn
    SystemRescueCd | Dual Boot | psychocats | FAQ

  5. #5
    Join Date
    May 2008
    Beans
    8
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Changed swap partition size

    Quote Originally Posted by Oldsoldier2003 View Post
    change your fstab to match the current partition information. you can do this by changing the UUID to match the new uuid of the swap partition (the UUID changed when you resized it) or simply change the /etc/fstab to load the swap partition via /dev or label. (you need superuser priveledges to save the changes)...
    This worked! I just had to run swapon -a as root

    Thanks so much for all your help guys.

Bookmarks

Posting Permissions

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