Mount HDD on Reboot

I’m attempting to mount an internal drive on reboot automatically.
I’ve prepared the drive using parted (created label and partition), and created a file system. I manually mounted the drive and was able to use it just fine.

However, despite playing around with fstab for an hour, my computer always fails to boot, or fails to mount the drive if it does boot.

My fstab entry looks like:
UUID=id-with-no-spaces /mnt/plex-library ext4 defaults 0 0

the /mnt directory is owned by root
/mnt/plex-library is owned by plex:plex with 770 permissions

Caveats:
If I add _netdev option to fstab entry, the computer will actually boot but doesn’t mount the drive until I double-click in Dolphin and provide a password. It then mounts in a random directory under / instead of the /mnt .

If I just use defaults I get a warning about dependency missing for /mnt/plex-library and go into emergency mode. I’m unable to boot until I comment out the fstab entry from chroot and reboot.

How about you provide the actual content of fstab as well as the result of blkid.

If you just say that everything is set up as should while not giving specifics it’s thought to spot the issue.

2 Likes

Thank you for taking the time to read and reply. I figured out what the issue was.

SOLUTION:
I discovered that a remnant of an MS-DOS MBR was still on the disk. After using dd to copy zeros across the MBR table, I updated the UUID in fstab (which was now different).

dd if=/dev/zero of=/dev/nvme1n1 bs=446 count=1 

I was under the impression that when you delete partitions with parted, and go through the process of creating a new label (e.g. GPT) with new partitions, that it would erase/overwrite any old tables like that.

I’m sure my ignorance played a role, but the various tutorials I was referencing gave the impression this would be handled automatically.

In the future, please reply with the solution instead so it can be marked :white_check_mark: as the solution. Otherwise, the post will never automatically close and will show up as a post that is not solved. :wink:

Note that I’ve done it for you this time. :wink:

2 Likes

The table and the partitions on it are 2 different things … or … ‘layers’.
This is also evident in tools like gparted where you would notice options like
Device > New Partition Table

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.