Koozali.org: home of the SME Server

Mounting USBs

Offline ElFroggio

  • *
  • 262
  • +0/-0
Mounting USBs
« on: July 24, 2012, 06:06:33 PM »
Hi,

I'm trying to automatically mount USB drives. The USBs are for the backups and NOT for the iBays. I've looked at: http://wiki.contribs.org/USBDisks and the SME8 section.

I don't understand how finding the device name sets the automatic mounting at startup. If somebody can explain to me how I can make this works.

Thanks


Offline Mirfster

  • *
  • 62
  • +0/-0
Re: Mounting USBs
« Reply #1 on: July 31, 2012, 05:43:15 PM »
Hello,

Maybe, I can help a little. 

If possible, can you provide the results of the following "mount" command?
Also, the make and model of the USB Drive (hopefully it is not a Seagate GoFlex..)?
Lastly, the contents of you "/etc/fstab"?

My USB drive is a WD 3 TB, in which I wiped the partition table in Windows and created and empty GPT partition.  From there, I formatted it using an Unbuntu GoLive CD as Ext3 and labeled it "USBBKUP".  (I am sure that there is a easier way, but my knowledge is limited.. )

Edited my "/etc/fstab" on the SME Server and added the line:
/dev/sdd1       /media/USBBKUP      ext3          defaults         0 0

Seems to work for me.  Hope this may help you.

Offline ElFroggio

  • *
  • 262
  • +0/-0
Re: Mounting USBs
« Reply #2 on: July 31, 2012, 06:11:57 PM »
Code: [Select]
[root@ethelbert ~]# mount
/dev/mapper/main-root on / type ext3 (rw,usrquota,grpquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/md1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sdb1 on /media/usbdisk type ext3 (rw)


[root@ethelbert ~]# cat /etc/fstab
#------------------------------------------------------------
# BE CAREFUL WHEN MODIFYING THIS FILE! It is updated automatically
# by the SME server software. A few entries are updated during
# the template processing of the file and white space is removed,
# but otherwise changes to the file are preserved.
# For more information, see http://www.e-smith.org/custom/ and
# the template fragments in /etc/e-smith/templates/etc/fstab/.
#
# copyright (C) 2002 Mitel Networks Corporation
#------------------------------------------------------------
/dev/main/root          /                       ext3    usrquota,grpquota        1 1
/dev/md1                /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/main/swap          swap                    swap    defaults        0 0
[root@ethelbert ~]#


The drives are different make: The current one is a WD640gb, there are some 1Tb, 1.5Tb, 2b and a couple of Seagate Baracudas. Those are naked hard drives that drop in a Thermaltake BlacX hard drive USB docking stations.

Thanks

Offline Mirfster

  • *
  • 62
  • +0/-0
Re: Mounting USBs
« Reply #3 on: July 31, 2012, 07:14:24 PM »
Looks to me as if what you are trying to end up with is being able to drop any of the hard drives in the External USB Caddy (ThermalTake) and have SME automatically mount it accordingly.

My guess would be that you labeled each drive and then added an entry in "fstab" for them, this might accomplish what you are looking for.

Example: the WD640GB hard drive is labeled as "WD640GB", then in fstab you have:
/dev/sdb1               /media/WD640GB            ext3          defaults         0 0

As I am tying this, I seem to recall something about using the "LABEL="; I think that this may actually be worth looking into in your case since the scenario might present itself where you are switching out the drives..


Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Mounting USBs
« Reply #4 on: July 31, 2012, 10:15:51 PM »
I don't understand how finding the device name sets the automatic mounting at startup.

It doesn't. :-)

Offline nmtrier

  • **
  • 38
  • +0/-0
Re: Mounting USBs for Backup
« Reply #5 on: August 24, 2012, 09:00:04 AM »
I have had to change the way I backup from V7.5 to V8.  I previously had 2 entries in fstab for 2 disks labelled BackupA & BackupB to mount to /media/usbdevice and configured to backup to usbdevice, whatever the label.  In this way I could rotate the 2 disk weekly ensuring an offsite backup.
In V8(& V7.6), if it is labelled you appear to only be able to configure backup to a currently attached but unmounted drive by its label, as fstab now only contains the mountpoint to the currently attached drive by its label (ie the LABEL commands in fstab are ignored).  I therefore relabelled both of my drives to BackupA, and setup backup to always use a drive with that label.
So I perform my full backup in the early hours of Tuesday, with instructions to the users to swap drives on Monday, ensuring each new backup set starts with a full backup followed by 6 incremental backups, all on the same disk which is then swapped and taken offsite.
...