Booting issues after crash during update
If it crashed during an update, you're in deep trouble. At this point, you have a few options:
- Reinstall, lose everything. (Easiest. I have done this myself a few times ;)
- Back up everything, reinstall. (Medium, requires a bit of linux knowledge.)
- Attempt to repair your current installation. (medium, requires a lot of time. May not work.)
Reinstall, lose everything
Install from the Live CD/USB, just like you did the first time. If you don't remember the procedure, or didn't install it yourself, read this before continuing.
DURING THE INSTALLATION PROCESS, if you're running a dual-boot, tell it to overwrite the existing Ubuntu installation. If it's a full-disk install (i.e., you don't have Windows installed on that computer as well,) just tell it to format the whole disk.
Back up your files, then reinstall
NOTE: For this, you'll need something to back the files up to.This is actually fairly simple.
While it's booting up, hold CTRL. You should see a screen with a purple background (sometimes it's black) and a few options. One of these is labeled as a "Recovery Mode". Choose it.
During the startup, you'll see a bunch of text on the screen, maybe some errors. Don't panic. Once it finishes, choose "Drop to root shell prompt".
You'll need to know the drive of your external HD (or whatever you're using to back up with.) Type, at the prompt: fdisk -l
You should see a bunch of info. If you pay attention, you'll see that it's arranged in a table. Try to puzzle out which entry is your external HD. (Guessing by size is usually a safe bet.)
Here's my partition table, for an example:
Disk /dev/sda: 160.0 GB, 160000000000 bytes 255 heads, 63 sectors/track, 19452 cylinders Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System /dev/sda1 * 1 12234 98263714+ 7 HPFS/NTFS /dev/sda2 12234 19453 57985025 5 Extended /dev/sda5 19192 19453 2094080 82 Linux swap / Solaris /dev/sda6 12234 19192 55890944 83 Linux
Partition table entries are not in disk order
Disk /dev/sdb: 8014 MB, 8014266368 bytes 255 heads, 63 sectors/track, 974 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sdb1 * 1 974 7823623+ b W95 FAT32
Here, /dev/sda
is my hard drive, and /dev/sdb
is a flash drive I had plugged in. (1024 MB = 1 GB)
Now, note the Device (e.g., /dev/sdb1
) and the filesystem type (e.g., NTFS.)
If it's NTFS, type sudo mount -t ntfs -o nls=utf8,umask=0222 /dev/FOO1 /media/
(replace FOO1
with the drive you found earlier - e.g., /dev/sdb1
)
If it's FAT32, type sudo mount -t vfat -o iocharset=utf8,umask=000 /dev/FOO1 /media/
(again, don't type FOO1.)
Now, a good idea is
mkdir /media/ubuntu-backup cp -Rv /home /media/ubuntu-backup
After if finishes, use another computer to double-check that the files are backed up, then do method 1 above to reinstall.
Attempt to repair your current installation
Use the process in method 2 to get to the root shell prompt. At the prompt, type:
dpkg-reconfigure -a
apt-get update
apt-get dist-upgrade
reboot
(If you'll be running it overnight, just type this one command: dpkg-reconfigure -a && apt-get update && apt-get dist-upgrade -y && reboot
. This will run all the commands in order, and tell the upgrade command not to ask any questions, unless there's a problem.)
BE SURE your internet is in a stable condition, and will be so for a while. After you execute the command, it will probably take a LONG time.
If this third method fails, just try method 2.