fstab bug or logic?


#/dev/disk/by-id/ata-WDC_WD1600AAJS-00L7A0_WD-WCAV38271474-part7 /var/run/media/      ext4       nofail,acl            1 2
/dev/disk/by-id/ata-WDC_WD3200BEVT-08A23T1_WD-WXC1A21T6168-part5 /var/run/media/Jim/Multimedia/ ntfs-3g nofail,users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0

So I use my portable openSUSE (in signature) at both office PC and home laptop. I have manually added two drives to mount automatically when found. The first line is the drive in the office, the second one is on my laptop.

I’ve found that when I use my laptop, the drive in the second line doesn’t mount automatically when boot, UNLESS I COMMENT the first drive.
Why is that?

I guess when it couldn’t find the drive in the first line, it has stopped looking for the one below??

I’m a bit guessing here, based on what I read on Lennart Poettering’s blog some time ago. When you have two entries in fstab

 device1 /dir1      bla bla 0 0[NEW LINE HERE]device2 /dir1/dir2 bla bla 0 0 

systemd creates a dependency between those two: /dir1/dir2 will not be mounted unless /dir1 is successfully mounted. So you should probably change the first entry such that it is no longer a parent directory of the second one. p.s.: Something is strange with the forum today. I had to turn /off/ JavaScript to be able to post at all, and the forum seems to remove all new lines in my text. So sorry for the strange layout of my answer.

> So I use my portable openSUSE (in signature) at both office PC and home
> laptop.

Wow! I didn’t know that was feasible. So the hardware must be virtually identically for the two machines without having
a schizophrenic OS experience!

> So I use my portable openSUSE (in signature) at both office PC and home
> laptop. I have manually added two drives to mount automatically when
> found. The first line is the drive in the office, the second one is on
> my laptop.

I imagine the fstab mount routine leaves once it table no longer begins to make sense.

> I’ve found that when I use my laptop, the drive in the second line
> doesn’t mount automatically when boot, UNLESS I COMMENT the first drive.
> Why is that?

You subsequence inference is probably the correct one.

> I guess when it couldn’t find the drive in the first line, it has
> stopped looking for the one below??

… of course you could test it by performing the reverse experiment.

But WHY? If you don’t have `official access’ to the office PC, you could just install openSUSE on your home machine and
use mount your external drive (for office use) with the appropriate symbolic links from /home/you/ to your external
drive to copy/store. That also gives you an added bonus of backup.

If you insist on using a single external hard drive, the only convenient workaround I can see you is creating a couple
of bash scripts to initialise the mounts manually after booting

e.g


sudo ~/mounthome.sh
sudo ~/mountwork.sh

or if you get into work at exactly the same time every morning, you could leave your home hard drive mount point in
/etc/fstab and run ~/mountwork.sh as a crontab entry under root.

I have manually added two drives to mount automatically when
On 2013-05-06, bonedriven <bonedriven@no-mx.forums.opensuse.org> wrote:
>
> Code:
> --------------------
>
> #/dev/disk/by-id/ata-WDC_WD1600AAJS-00L7A0_WD-WCAV38271474-part7 /var/run/media/ ext4 nofail,acl 1 2
> /dev/disk/by-id/ata-WDC_WD3200BEVT-08A23T1_WD-WXC1A21T6168-part5 /var/run/media/Jim/Multimedia/ ntfs-3g nofail,users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
>
> --------------------
>
>
> So I use my portable openSUSE (in signature) at both office PC and home
> laptop. I have manually added two drives to mount automatically when
> found. The first line is the drive in the office, the second one is on
> my laptop.
>
> I’ve found that when I use my laptop, the drive in the second line
> doesn’t mount automatically when boot, UNLESS I COMMENT the first drive.
> Why is that?
>
> I guess when it couldn’t find the drive in the first line, it has
> stopped looking for the one below??
>
>

On 2013-05-06 20:46, bonedriven wrote:
>
> Code:
> --------------------
>
> #/dev/disk/by-id/ata-WDC_WD1600AAJS-00L7A0_WD-WCAV38271474-part7 /var/run/media/ ext4 nofail,acl 1 2
> /dev/disk/by-id/ata-WDC_WD3200BEVT-08A23T1_WD-WXC1A21T6168-part5 /var/run/media/Jim/Multimedia/ ntfs-3g nofail,users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
>
> --------------------

Ok, stop here.

You can not use /var/run/media/, nor /media, nor /run or any variant as
mount points in fstab. Those are directories reserved for the system,
not for you.

Use /mnt/something.

Repeat and come back :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

True.

And may I add that mounting at /var/run/media/Jim/Multimedia/ is not possible if the mount point does not exist. Which you do not prove and which is probably not the case when the other mount at /var/run/media/ did not take place.

Thanks. I changed both to /mnt/1 and mnt/2 (without changing order). It can mount automatically now.

This does look like the reason behind it. But I don’t wanna reboot again and again to test it out one more time. :smiley: For example, make it mnt/1 and mnt/1/2 to test.

Yes, it can be done. Ofc the hardwares are totally different… I’m amazed too. In fact, I installed openSUSE 12.2 on the office PC too, and it couldn’t boot
without installing nvidia driver manually. I don’t know why this portable openSUSE 12.3 which was installed using the same PC can survive the boot without installing any graphic card driver manually. I can only say, it’s **** smart.

You realize that /mnt/1/2 path must be created on the first filesystem, not on the root? I.e. in

mkdir -p /mnt/1/2
mount /dev/sdd1 /mnt
mount /dev/sdd2 /mnt/1/2

last command most likely fails.

Yes, that is the same message I try to get through, but I seem to fail. I hope your’s does.