4

Running Ubuntu 15.04. I was receiving messages about my root / partition running out of space, and so I looked up how to allocate more space to it. I followed the answer to this question: How to extend my root (/) partition?

After turning swapoff, deleting the swap parition, and hitting Apply all operations, I executed the command sudo resize2fs /dev/sda10 (in my case, I used sda8, as it is my root partition) and it said: The filesystem is already 2441472 (4k) blocks long. Nothing to do! . I restarted the machine, and once it reached the Ubuntu screen with the loading dots it stayed there for about 2 minutes before proceeding to the login screen.

I figured I messed something up with the boot process, so I thought I'd recreate the swap space. I opened up GParted and created a new parition in the unallocated space, allocated it as swap, hit swapon, Apply all operations, and restarted. Same thing happens. Every time I restart or do a fresh boot, it hangs on the loading screen for a good 2-3 minutes and then proceeds to the login screen.

I don't see why deleting the swap partition would have messed with the boot, as I understand it is only really used for hibernation.

  • Have you checked your /etc/fstab to make sure that after deleting (and recreating) the swap partition everything is in place and mounted properly on boot? – boshra May 18 '15 at 3:06
4

If you want to remove the swap partition, you should first try by commenting its entry in /etc/fstab, then reboot.

As for the long boot time, it may be that one of your filesystems has been damaged. As soon as your system is up, run the appropriate fsck.* command for each of the file systems. If it reports errors, it will usually recommend how to fix them.

(Btw, running a system without swap is perfectly normal. I'm doing this since several years – these days, common machines have enough RAM.)

  • Commenting out the swap entry in /etc/fstab fixed the boot problem. Thanks! – Ryan McClure May 18 '15 at 17:59
  • Thanks lxg. I have been dual-booting ubuntu-type OSs on 'modern systems' these past couple of years. Always annoying when the first installed system would take >1min 30 sec to boot. Your suggestion to delete swap entries from /etc/fstab, then delete swap partitions using Gparted, did the trick. – aarn Dec 18 '16 at 3:14
2

I had about the same problem. When I removed my swap partition, the system kept booting very slowly. Although my situation was different from that of the OP, I hope it will be useful to others. I'm adding it here because this was my first hit when searching for solutions.

For me commenting out the relevant line in /etc/fstab as indicated by other answers did not yet solve it. It turned out that I had an encrypted swap partition enabled, which may be the default if your home directory is encrypted.

Look at /etc/crypttab, and comment out any lines referring to a partition that no longer exists. For me, removing this line reduced the boot time from ~3 minutes to the usual < 1.

  • Thanks... I knew that this was the problem but I couldn't find where erase the partition. Thanx. – Torrien Jan 16 at 0:49
2

From Terminal run

    sudo blkid

Then

    cat /etc/fstab

Double check that the fstab entry for swap partition matches all entries in the blkid

Your fstab entry should look something like this=>

    UUID=your/UUID/here none      swap    sw        0       0

If they don't match with each other, change UUID in fstab using your preferred text editor, to match the one you get from command sudo blkid. Then reboot and you'll see the effect.

1

You may also need to edit the /etc/initramfs-tools/conf.d/resume file and comment out any references to the deleted Swap partition

sudo nano /etc/initramfs-tools/conf.d/resume
#RESUME=UUID=2854a8db-6494-44ac-9cee-974714bb0b00

I commented out the swap entries in /etc/fstab and the slow boot wasn't resolved. I also made sure that my swap wasn't encrypted, since no /etc/crypttab existed as suggested by @ankit7540. In the end, i came across this error message while installing a virtualization package and this gave me the right direction

W: initramfs-tools configuration sets RESUME=UUID=2854a8db-6494-44ac-9cee-974714bb0b00
W: but no matching swap device is available.

From the docs:

The initramfs is an cpio archive. At boot time, the kernel unpacks that archive into ram, mounts and uses it as initial root file system. From there on the mounting of the real root file system occurs in user space.

resume
      The resume hook tries to autodetect the resume partition and uses  the  first  swap
      partition   as  valid  guess.  It  is  possible  to  set  the  RESUME  variable  in
      /etc/initramfs-tools/conf.d/resume.  The boot variable noresume overrides it.

In simpler words, since a swap partition is a requirement for hibernation in Ubuntu, it makes sense that it'll be defined in some boot config as the RESUME parition and the boot process will look for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.