Page 1 of 1

That fstab thing/mounting ext. HD at boot time

Posted: 09 Mar 2012, 13:51
by viking60
Well I have never been good at fiddling around with my fstab. It is supposed to work out of the box anyway.
But I have this small problem with my external LaCie HD
Image

On my Mandriva Box it does not mount on boot - and that is bad! +1 But it has this power on/off switch; and when I hit that and turn it back on it is mounted nicely.

So I dance away to my /etc/fstab :dance1 cause I have read somewhere that it is the place for taking care of stuff like this.
(I have added the usb to my groups)
I notice that all my mounts are done with UUID which is a good thing because it will not matter how I connect my external disks.
In the old days I have experienced that my disks have swapped place and gave me some boot trouble etc.
So UUID is good - I have got that.
Now how to find the UUID of that external USB Disk? I have got that too:

Code: Select all

ls -l /dev/disk/by-uuid

Since I will forget this command I made an alias out of it:

Code: Select all

alias uuid='ls -l /dev/disk/by-uuid'

So everytime I write uuid I get the uuid of my disks:

Code: Select all

:) uuid
totalt 0
lrwxrwxrwx 1 root root 10 2012-03-09 13:23 23a0dd5a-40b5-4c94-a583-8e278b0f7491 -> ../../sda7
lrwxrwxrwx 1 root root 10 2012-03-09 13:25 323B-2942 -> ../../sdb2
lrwxrwxrwx 1 root root 10 2012-03-09 13:23 4527c277-18a1-4032-b302-5cf065806805 -> ../../sda5
lrwxrwxrwx 1 root root 10 2012-03-09 13:23 5639bb34-8c88-4f68-aebd-361855e85c6d -> ../../sda6
lrwxrwxrwx 1 root root 10 2012-03-09 13:23 7432F81932F7DDD4 -> ../../sda1
lrwxrwxrwx 1 root root 10 2012-03-09 13:25 F20042050041D171 -> ../../sdb1


Now that last one is the one in question here so I went to /etc/fstab and added something like this:
#Entry for /dev/sdb1 :

Code: Select all

UUID=F20042050041D171 /media/LaCie  auto defaults 0 0


The rest of my /etc/fstab looks like this:
:A

Code: Select all

#Entry for /dev/sda5 :
UUID=4527c277-18a1-4032-b302-5cf065806805 / ext4 relatime 1 1
#Entry for /dev/sda6 :
UUID=5639bb34-8c88-4f68-aebd-361855e85c6d /home ext4 relatime 1 2
#Entry for /dev/sda1 :
UUID=7432F81932F7DDD4 /media/win ntfs-3g defaults,umask=000 0 0
none /proc proc defaults 0 0
none /tmp tmpfs defaults 0 0
#Entry for /dev/sda7 :
UUID=23a0dd5a-40b5-4c94-a583-8e278b0f7491 swap swap defaults 0 0


And that thorughly fubars the mounting of my USB HD :berserkf Now the on/of button gives me an error message and the HD is still not mounted on boot.
The folder LaCie does appear in /media when the disk is mounted so I figured I did not need to create it.
But then again I am figuring wrong here obviously.

The filesystem I get from df -T is fuseblk (it is ntfs) :confused

Code: Select all

/dev/sdb1  fuseblk    1,8T  1,2T  670G  64% /media/LaCie

I tried that instead of auto in fstab but no luck.
As usual when I fubar it probably is something very simple that you Gurus will spot right away - so Help!

Edit:
When auto mounted the disk looks like this:

Code: Select all

/dev/sdb2     vfat     30G  381M   30G   2% /media/LA-PUBLIC
/dev/sdb1  fuseblk    1,8T  1,2T  670G  64% /media/LaCie


It mounts some windows stuff called LA-PUBLIC that is vfat. But when I mount with gigolo I am able to mount only LaCie.

Re: That fstab thing

Posted: 09 Mar 2012, 18:24
by rolf
I believe if you mount by 'mount' or an fstab entry, which is about the same mechanism, afaik, it will fail if the mount point does not exist. You might try that: making the mount point in the filesystem. Maybe make the mount point unique from what automount creates, to avoid conflicts. :confused

Code: Select all

mkdir -p /mnt/LaCie


for example. :think:

Also, I think the protocol for the fstab entry is a bit different from what you have. One of my ntfs partitions was configured by the Mandriva automagic installer thusly:

Code: Select all

UUID=561351657DD6DA9E /media/win_c ntfs-3g defaults,umask=000 0 0


Try with specifying the file system explicitly. See 'man fstab' for the field explanations but I would think using the same values in your entry, except UUID and mount point, of course, ought to be valid. :pray:

Re: That fstab thing

Posted: 10 Mar 2012, 18:41
by dedanna1029
What he said. ^^

Re: That fstab thing

Posted: 10 Mar 2012, 21:07
by viking60
Hmm no big success so far. Trying some more combinations....
I get a lot of only root can mount.

Re: That fstab thing

Posted: 10 Mar 2012, 22:35
by dedanna1029
Try:

Code: Select all

mkdir -p /media/LaCie

And mount to it. You can drop the -p of that conceivably.

Re: That fstab thing

Posted: 10 Mar 2012, 22:54
by viking60
That does already exist as the default. That is where it mounts when I turn it on without any problem. The problem is to get it to mount during boot.

Re: That fstab thing

Posted: 10 Mar 2012, 23:00
by dedanna1029
Ah, yeah, sorry, there was a lot up there to sort through.

Re: That fstab thing

Posted: 12 Mar 2012, 11:57
by viking60
Well i found a way to mount it correctly from the CLI:

Code: Select all

/usr/bin/udisks --mount /dev/sdb1

That should bring me somewhat further. I could put it in /etc/rc.local I guess. But that would fubar the "UUID mount correctly even if attached to another USB port or after a software upgrade" advantage.
To make sure it is always mounted correctly this seems to be the correct way:

Code: Select all

/usr/bin/udisks --mount /dev/disk/by-uuid/F20042050041D171

......
And putting it in /etc/rc.local did not work - I guess the timing is not correct. So I am going to add a launcher to gnome-shell-properties with this command:

Code: Select all

/usr/bin/udisks --mount /dev/disk/by-uuid/F20042050041D171

You whish me the best of luck :pray:
....
Et voila Ladys and Gentlemen:
It worked
:dancer

Re: That fstab thing  Topic is solved

Posted: 12 Mar 2012, 12:32
by viking60
Ok to sum this up:
I started out with the "fstab thing" and meant "mounting my External HD at boot time".
In fact the HD was perfectly mounted every time I connected it; so it was not so much the mounting as it was the timing.
But making automated backups to that disk over the network, looses a lot of functionality if I cannot ensure that it is mounted at boot.

So I ended up with this solution:
Added a launcher in gnome-shell-properties and called it LaCie and entered this command:

Code: Select all

/usr/bin/udisks --mount /dev/disk/by-uuid/F20042050041D171

This looks more understandable when presented like this:
/usr/bin/udisks --mount /dev/sdb1 and it will do the same but you cannot be sure it is correctly mounted the next time you connect your HD to an USB-port - with UUID you can be!
The UUID number contained above I found by punching

Code: Select all

ls -l /dev/disk/by-uuid

And copying the code from my external USB-disk.
(to find all connected disks, mounted or not; as root:

Code: Select all

 fdisk -l

I did not have to touch /etc/fstab :-D

Life is good again - and maybe someone can learn from my stupid mistakes - or as Einstein put it:
Every idiot can learn from their own mistakes - the genius learns from the mistakes of others..

I am sure our Gurus will enlighten us regarding how to add launchers in KDE +1

Re: That fstab thing/mounting ext. HD at boot time[SOLVED]

Posted: 16 Mar 2012, 13:52
by viking60
Hmm I have fiddled around with the autostart programs in KDE :boohoo: and it seems to be a bit more complicated than in Gnome:
You need to add a text file named what you want to autostart to

Code: Select all

~/.kde4/Autostart

like this I guess:

Code: Select all

#!/bin/bash
/usr/bin/udisks --mount /dev/disk/by-uuid/F20042050041D171

And save it as LaCie in this case.

You can also do it by the system settings menu in the KDE, menu under system administration...