Mount partition with fstab not working

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Liquid Divide

Mount partition with fstab not working

Post by Liquid Divide »

I get different results when I mount a partition using a line in the fstab file versus running a

Code: Select all

sudo mount
command.

here is the line from my fstab file.

Code: Select all

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /my/mount/path ext4    defaults        0       1
when this is run on boot or with

Code: Select all

sudo mount -a
the drive appears on the desktop, but the contents of the folder it is mounted to are empty.

This partition is /dev/sdb1. When I mount the drive using

Code: Select all

sudo mount /dev/sdb1 /my/mount/path
then the drive appears and all the contents appear in the mounted folder location. I've tried modifying my fstab line to use /dev/sdb1 instead of the UUID of the partition, but I get the same result as using the UUID.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
MintBean

Re: Mount partition with fstab not working

Post by MintBean »

Try that. That's what I use in fstab for a data disc.

Code: Select all

UUID=*whatever* /mnt/Data auto noatime,nosuid,nodev,nofail,x-gvfs-show 0 0
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Mount partition with fstab not working

Post by austin.texas »

Liquid Divide wrote: here is the line from my fstab file.

Code: Select all

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /my/mount/path ext4    defaults        0       1
when this is run on boot or with

Code: Select all

sudo mount -a
the drive appears on the desktop, but the contents of the folder it is mounted to are empty.
Then where is it mounted?

Code: Select all

inxi -p
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Liquid Divide

Re: Mount partition with fstab not working

Post by Liquid Divide »

austin.texas wrote:
Liquid Divide wrote: here is the line from my fstab file.

Code: Select all

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /my/mount/path ext4    defaults        0       1
when this is run on boot or with

Code: Select all

sudo mount -a
the drive appears on the desktop, but the contents of the folder it is mounted to are empty.
Then where is it mounted?

Code: Select all

inxi -p
It's being mounted to the correct location, but nothing shows up in that location. inxi -p gives the expected output.
bigal
Level 5
Level 5
Posts: 510
Joined: Mon Aug 03, 2009 3:26 am
Location: Pembrokeshire, South West Wales

Re: Mount partition with fstab not working

Post by bigal »

I use fstab to mount an additional drive using a somewhat similar entry to yours. However, it is necessary to have created the destination first. My destination folder is called 015data so from my ‘Home’ folder I create an empty folder called ‘015data’. This name is the one in the fstab entry. Once this empty folder is in place I can run

Code: Select all

$ sudo mount -a
and my new folder is filled. It also gets filled when I boot up or reboot which, of course, is what is normally wanted. If there is an occasion when this is not wanted you can “hash” out the relevant line prior to the reboot. One thing to be aware of though is that you might have to change file permissions, owner and group to you to have read/write access to the folder contents. When setting these permissions use the

Code: Select all

-R
switch to ensure that the changes are reflected in all the folders and files within.

One other thing. I know others disagree with me but I believe that the final entry in the fstab line should be ‘2’ not ‘1’. To quote from the man (8) page:
The sixth field (fs_passno).
This field is used by fsck(8) to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a
fs_passno of 1. Other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different
drives will be checked at the same time to utilize parallelism available in the hardware. Defaults to zero (don't fsck) if not present.
.
Lots of Minty machines but there again I like lamb and I do live in Wales!
Locked

Return to “Storage”