New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

How to permanently mount eSATA

Got problems with your B2 or B3? Share and get helped!
Post Reply
dan_bub
Posts: 22
Joined: 23 Jan 2009, 04:08

How to permanently mount eSATA

Post by dan_bub »

Hi,
I would like to have my eSATA-drive mounted permanently, because Bubba2 hands out a new device name when i reboot my desktop machine, for exsample:
HDT722525DLA380 /dev/sdh4 unused ATA
turnes into
HDT722525DLA380 /dev/sdi4 unused ATA
The fstab shows:

Code: Select all

/dev/mapper/bubba-storage       /home   ext3    defaults                0       2
What do I have to set in to get the drive mounted permanently, so the scripts in crontab point to the right backup divice?
Thanks in advance
dan_bub
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: How to permanently mount eSATA

Post by RandomUsername »

I don't understand - you reboot your desktop PC and it changes the device name on the Bubba? That makes no sense.

Does the Bubba not create a mount point in /home/storage/extern for your eSATA drive? That's how it works with USB drives and the names are consistent IME. All you should need to do is add that mount point to your fstab.
dan_bub
Posts: 22
Joined: 23 Jan 2009, 04:08

Re: How to permanently mount eSATA

Post by dan_bub »

....That makes no sense.
I agree.
Does the Bubba not create a mount point in /home/storage/extern for your eSATA drive?
Yes, it does, but it somehow gets unmounted, and than a new device name is used. (see picture)

I am used to mount a samba share:

Code: Select all

//bubba/home/test   /media/bubba_test   cifs  rw,auto,username=test,password=test,uid=test,gid=users  0 0
Could that have an impact?
Attachments
bubba-forum-eSATA.jpg
bubba-forum-eSATA.jpg (23.78 KiB) Viewed 13069 times
ryz
Posts: 183
Joined: 12 Feb 2009, 06:03

Re: How to permanently mount eSATA

Post by ryz »

What he is saying is making a lot of sense. He is not taking about the mount point but rather the device file hence the path starts with /dev. Bubba 2 as I think all new distributions is using udev to attached devices and this can lead to different device names upon boot. So that mean you should not use /dev/sd something but rather use the unique UUID that each partition get. You should hence use the path below where you should exchange the <UUID> to the UUDI of the partition you want to use.
/dev/disk/by-uuid/<UUID>
You could either get the UUID by doing an

Code: Select all

ls -l /dev/disk/by-uuid
or running the blkid as root.

Code: Select all

su -
blkid /dev/sdh4
dan_bub
Posts: 22
Joined: 23 Jan 2009, 04:08

Re: How to permanently mount eSATA

Post by dan_bub »

This is what "df" returns:

Code: Select all

bubba:/# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              9621848    998104   8134968  11% /
tmpfs                   128228         0    128228   0% /lib/init/rw
udev                     10240        44     10196   1% /dev
tmpfs                   128228         4    128224   1% /dev/shm
/dev/mapper/bubba-storage
                     470050224 165948900 280224104  38% /home
/dev/sdb2            445369340 196417784 226328020  47% /home/storage/extern/disk_0
/dev/sdb5            516045624 225718944 264112220  47% /home/storage/extern/disk_1
/dev/sdc2            445369340 196417784 226328020  47% /home/storage/extern/disk_2
/dev/sdc5            516045624 225718944 264112220  47% /home/storage/extern/disk_3
/dev/sdd2            445369340 196417784 226328020  47% /home/storage/extern/disk_4
/dev/sde2            445369340 201666424 221079380  48% /home/storage/extern/disk_5
/dev/sde5            516045624 227497780 262333384  47% /home/storage/extern/disk_6
/dev/sdf4            158309316    192072 150075508   1% /home/storage/extern/disk_7
/dev/sdg4            158309316    192072 150075508   1% /home/storage/extern/disk_8
/dev/sdg2             30723732    253780  28909240   1% /home/storage/extern/disk_9
bubba:/#
and "ls -l /dev/disk/by-uuid" returns:

Code: Select all

bubba:/# ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 2010-06-06 09:43 1bb5eebf-01aa-4b3f-ad00-7c3ba65f8b9a -> ../../sdh2
lrwxrwxrwx 1 root root 10 2010-05-31 11:51 5cb68955-9621-4a61-84e3-73f0170fe383 -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-06-06 09:43 6448261a-7170-4d7b-ae24-614a5c218a59 -> ../../sdh4
lrwxrwxrwx 1 root root 10 2010-06-06 09:43 7e228f98-7b1f-48e5-b608-eca747e330d9 -> ../../sdh1
lrwxrwxrwx 1 root root 10 2010-06-06 09:43 a5b8a9ae-b037-43ef-8cc9-729ac1b4e4b6 -> ../../sdh3
bubba:/#
And finaly the "blkid" command:

Code: Select all

bubba:/# blkid /dev/sdh4
/dev/sdh4: LABEL="bubba_rsync" UUID="6448261a-7170-4d7b-ae24-614a5c218a59" SEC_TYPE="ext2" TYPE="ext3"
I am a bit confused. How do I express that right so it fits for the fstab?
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: How to permanently mount eSATA

Post by RandomUsername »

Using your fstab entry above as an example, instead of this:
//bubba/home/test /media/bubba_test cifs rw,auto,username=test,password=test,uid=test,gid=users 0 0
Do this:
UUID=6448261a-7170-4d7b-ae24-614a5c218a59 /media/bubba_test cifs rw,auto,username=test,password=test,uid=test,gid=users 0 0
@ryz
What he is saying is making a lot of sense. He is not taking about the mount point but rather the device file hence the path starts with /dev. Bubba 2 as I think all new distributions is using udev to attached devices and this can lead to different device names upon boot.
I would agree with that, but he's not talking about rebooting his Bubba, he's talking about rebooting his desktop PC.
dan_bub
Posts: 22
Joined: 23 Jan 2009, 04:08

Re: How to permanently mount eSATA

Post by dan_bub »

ok, I was a bit slow, I have to use

Code: Select all

UUID="6448261a-7170-4d7b-ae24-614a5c218a59" 
I'll try that and post the result.
dan_bub
Posts: 22
Joined: 23 Jan 2009, 04:08

Re: How to permanently mount eSATA

Post by dan_bub »

I would agree with that, but he's not talking about rebooting his Bubba, he's talking about rebooting his desktop PC.
Well since Bubba was not rebooted, my wild guess was the samba share and the reboot of the desktop PC.
It is a bit strange, that Bubba keeps the old eSATA-mounts listed so.
dan_bub
Posts: 22
Joined: 23 Jan 2009, 04:08

Re: How to permanently mount eSATA

Post by dan_bub »

Seems that I can't handle this UUID-thing. :?
I tried the unmodern way:

Code: Select all

bubba:/# mkdir -m 775 /home/storage/extern/bubba_rsync
bubba:/#chown admin /home/storage/extern/bubba_rsync
bubba:/#chgrp users /home/storage/extern/bubba_rsync
I registered the new mountpoint with fstab:

Code: Select all

bubba:/etc# cat fstab
/dev/sda1       /       ext3    noatime,defaults        0       1
/dev/mapper/bubba-storage       /home   ext3    defaults                0       2
/dev/sda3       none    swap    sw                      0       0
usbfs           /proc/bus/usb   usbfs   defaults        0       0
/proc           /proc   proc    defaults                0       0
/dev/sdh4 /home/storage/extern/bubba_rsync rw,auto  0 0

Code: Select all

ubba:/etc# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              9621848    998212   8134860  11% /
tmpfs                   128228         0    128228   0% /lib/init/rw
udev                     10240        44     10196   1% /dev
tmpfs                   128228         4    128224   1% /dev/shm
/dev/mapper/bubba-storage
                     470050224 165949012 280223992  38% /home
/dev/sdb2            445369340 196417784 226328020  47% /home/storage/extern/disk_0
/dev/sdb5            516045624 225718944 264112220  47% /home/storage/extern/disk_1
/dev/sdc2            445369340 196417784 226328020  47% /home/storage/extern/disk_2
/dev/sdc5            516045624 225718944 264112220  47% /home/storage/extern/disk_3
/dev/sdd2            445369340 196417784 226328020  47% /home/storage/extern/disk_4
/dev/sde2            445369340 201666424 221079380  48% /home/storage/extern/disk_5
/dev/sde5            516045624 227497780 262333384  47% /home/storage/extern/disk_6
/dev/sdf4            158309316    192072 150075508   1% /home/storage/extern/disk_7
/dev/sdg4            158309316    192072 150075508   1% /home/storage/extern/disk_8
/dev/sdg2             30723732    253780  28909240   1% /home/storage/extern/disk_9
/dev/sdh4            158309316    222420 150045160   1% /home/storage/extern/bubba_rsync
So this is working. To test it, I come to my acctual goal backing up the users Mail-folder:

Code: Select all

bubba:/home/storage/extern# rsync -a /home/test/Mail /home/storage/extern/bubba_rsync/test

bubba:/home/storage/extern/bubba_rsync/test# dir
Mail
I guess it is oldfashion, but it works until now. No idea If it conflicts with "dev/mapper/bubba-storage" at some point?
But why are those disk_0-9 listed? The eSATA-drive has only 4 partitions on it, so it must be some old stuff?
Do I have to remove them manually?
Attachments
bubba-forum-eSATA1.jpg
bubba-forum-eSATA1.jpg (101.76 KiB) Viewed 13058 times
ryz
Posts: 183
Joined: 12 Feb 2009, 06:03

Re: How to permanently mount eSATA

Post by ryz »

The easy way to use the UUID thing is to change the line

Code: Select all

/dev/sdh4 /home/storage/extern/bubba_rsync rw,auto  0 0
to

Code: Select all

/dev/disk/by-uuid/6448261a-7170-4d7b-ae24-614a5c218a59 /home/storage/extern/bubba_rsync rw,auto  0 0
Or I guess an more correct way to write this in the fstab file is

Code: Select all

UUID=6448261a-7170-4d7b-ae24-614a5c218a59 /home/storage/extern/bubba_rsync rw,auto  0 0
Don't ask me what all the other disk and stuff is because I have no clue.
dan_bub
Posts: 22
Joined: 23 Jan 2009, 04:08

Re: How to permanently mount eSATA

Post by dan_bub »

@ryz
Or I guess an more correct way to write this in the fstab file is

Code: Select all
UUID=6448261a-7170-4d7b-ae24-614a5c218a59 /home/storage/extern/bubba_rsync rw,auto 0 0
Yes, you are right, now it works. The only thing missing was the filesystem, so I changed it to:

Code: Select all

UUID=6448261a-7170-4d7b-ae24-614a5c218a59 /home/storage/extern/bubba_rsync  ext3   defaults   0 0
Everything is working now.

Thanks to everybody for listening and help.
Regards
dan_bub
Post Reply