Mount partition with fstab not working

Forum rules
Before you post please read this
Post Reply
Liquid Divide
Level 1
Level 1
Posts: 13
Joined: Sat Apr 01, 2017 11:25 am

Mount partition with fstab not working

Post by Liquid Divide » Fri Jul 14, 2017 1:46 pm

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.

User avatar
MintBean
Level 9
Level 9
Posts: 2854
Joined: Fri Aug 07, 2015 6:54 am
Location: Blighty

Re: Mount partition with fstab not working

Post by MintBean » Fri Jul 14, 2017 2:02 pm

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: 12055
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Mount partition with fstab not working

Post by austin.texas » Fri Jul 14, 2017 2:10 pm

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
Level 1
Level 1
Posts: 13
Joined: Sat Apr 01, 2017 11:25 am

Re: Mount partition with fstab not working

Post by Liquid Divide » Sat Jul 15, 2017 12:34 am

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 4
Level 4
Posts: 226
Joined: Mon Aug 03, 2009 3:26 am
Location: Pembrokeshire, South West Wales

Re: Mount partition with fstab not working

Post by bigal » Tue May 08, 2018 11:51 am

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.
.

Post Reply

Return to “Mounting Partitions”