A fresh install of Ubuntu Server is refusing to boot and hanging on "Adding 524284k swap on /dev/mapper/test--vg-swap_1. Priority:-1 extents:1 across:524284k

I can get around this by dropping onto recovery mode and just resuming to a normal boot.

2 Answers 2


It is doing this because Ubuntu is trying to switch to a high resolution video mode for the console and your hardware isn't cooperating.

Fixing this while at the machine

When Grub2 shows up:

  • Highlight the menu item for Ubuntu and press 'e'
  • Go to the line where it loads the kernel and press 'End' to go to the end of the line
  • Add 'nomodeset'
  • Press F10 or Ctrl-X to boot it

With any luck it will boot into the login screen. This won't save that option but at least now you can edit the file for Grub2 and update it to save that option if it works. I blogged about this recently.

Fixing this for good

  • Log in (ssh will probably do, if you know the machine's IP)
  • Update the grub config file nano /etc/default/grub
  • Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT
  • Edit the line to include nomodeset, in my case, the line looked like this afterwards: GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
  • Save/exit nano
  • Run update-grub
  • Reboot
  • 2
    Thank you! For others, the line you add nomodeset to is the line that starts with linux /boot/vmlinuz..., not the initrd line. Dec 26, 2014 at 7:44
  • 2
    Note: The easy way of doing this with modern versions of GRUB is by editing /etc/default/grub and add "nomodeset" (separated by a space) to the end of the GRUB_CMDLINE_LINUX_DEFAULT variable.
    – Ernie
    Feb 24, 2015 at 21:26
  • 1
    Thanks, this fixed my problem with Ubuntu 14.04 LTS on a Mac Mini.
    – Nelson
    Feb 28, 2015 at 20:49
  • 3
    @Ernie: then update-grub.
    – Gauthier
    Mar 5, 2015 at 9:06
  • Gauthier: you're right! Thanks, and +1
    – Ernie
    Mar 6, 2015 at 19:33

How did you add it? You may want to format the swap again. What you can do is boot under rescue mode, mount the vgs and do:

# mkswap /dev/mapper/test--vg-swap_1

# swapon /dev/mapper/test--vg-swap_1

Then add it again to the /etc/fstab if it's not present.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .