1

I am running Ubuntu 18.10. I tried reformatting my secondary HDD (Ubuntu is on an SSD) to ext4 and changed the /etc/fstab file to automount the drive on startup.

I must have done something wrong because now I can only boot into emergency mode.

By my logic the problem would be solved If I just unmounted the HDD and edited the fstab file of which I made a backup a while ago.

The problem is that I have no idea how to do that from emergency mode. None of the usual commands work.

EDIT2: I just booted via USB-Stick and this is the (i guess faulty) fstab file:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=5ece23e7-beea-431d-9960-4ef8f83df532 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=0D53-953B  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

# 1TB DATA HDD:
7264c768-09ca-4e0e-aeb7-018a3a25badb /media/DATA    ext4    defaults    0   0
5
  • Could you post your fstab config, hard to say what you have done wrong if not know what you have done. Apr 10, 2019 at 20:47
  • I don't understand why you would need to unmount a drive in order to change its fstab entry? Apr 10, 2019 at 21:03
  • Well my logic isn't flawless. Anyways, I booted from a USB stick an can access the fstab file. Is it safe to just remove the line? I will update my post in a second.
    – EVARATE
    Apr 10, 2019 at 21:12
  • ... what you will need to do however is remount the drive on which the fstab file is located with rw enabled e.g. mount -o remount,rw / Apr 10, 2019 at 21:13
  • @steeldriver that won't work if they're booted to a Ubuntu Live USB :-)
    – heynnema
    Apr 10, 2019 at 21:19

1 Answer 1

1

If you mean Recovery Mode, and you can get to the # prompt, then type:

sudo mount -o rw,remount / # remount the disk rw

cd /etc # change directory

sudo pico fstab # to edit existing fstab

or, if you wish to restore your backup fstab:

sudo mv fstab fstab.bad # rename existing file, for safety

sudo cp fstab.backup fstab # restore backup fstab, use your own name

If you can't do any of this, then you'll have to boot to a Ubuntu Live DVD/USB, mount the HDD by using the Files (Nautilus) application, click on the HDD in the left pane, navigate to the /etc directory on the HDD, edit fstab, etc.

Update #1:

Make sure that /media/DATA mount point exists.

Change this line in fstab:

7264c768-09ca-4e0e-aeb7-018a3a25badb /media/DATA    ext4    defaults    0   0

to this:

UUID=7264c768-09ca-4e0e-aeb7-018a3a25badb /media/DATA    ext4    defaults,nofail    0   2
4
  • And yes folks... I used sudo... as some commands still require it, even in recovery mode...
    – heynnema
    Apr 10, 2019 at 21:17
  • Wait, did I just accidentally remove the UUID= ? That's embarrassing. Holy crap.
    – EVARATE
    Apr 10, 2019 at 21:22
  • Thanks man, that fixed it. I feel stupid now. Have a good day.
    – EVARATE
    Apr 10, 2019 at 21:25
  • @EVARATE change the last 0 0 to 0 2 so the drive will get checked at boot time, and add nofail, so the system will still boot if this drive is not available.
    – heynnema
    Apr 10, 2019 at 21:30

You must log in to answer this question.

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