From SME Server
Jump to: navigation, search

support for ntfs does exist,

But it may be simpler after we reach kernel 2.6.12 when FUSE support is included in the kernel.
If ntfs is going to fail everytime a kernel is upgraded it's too much hassle

Snoble 08:17, 25 October 2007 (MDT)

automount USB Disk, Draft instructions,
the best location to mount and best mount options need to be decided [actually, this doesn't use the LABEL method so will work best if you only use one disk and plug it into the same usb port :-(]

refer bottom of page.

yum install autofs

nano -w /etc/auto.master
/var/autofs/removable   /etc/auto.removable     --timeout=5

nano -w /etc/auto.removable
cdrom     -fstype=iso9660,ro,sync,nodev,nosuid      :/dev/cdrom
floppy    -fstype=auto,sync,nodev,nosuid            :/dev/fd0
MaxExt3   -fstype=ext3,defaults                     :/dev/sda1
MaxVfat   -fstype=vfat,uid=1002,gid=1002,umask=002  :/dev/sda2

mkdir -p /var/autofs/removable 

/etc/init.d/autofs restart

ll /var/autofs/removable/MaxVfat/
-rwxrwxr-x  1 smelog smelog  79811 Oct 25 23:04 fuse-2.6.3-3.EL4.i686.rpm

ll /var/autofs/removable/cdrom
dr-xr-xr-x    3 root root  2048 Jun 17 12:11 home
dr-xr-xr-x  618 root root 77824 Oct 25 05:04 rr_moved

 ll /var/autofs/removable/MaxExt3
-rw-r--r--  1 root root     10 Oct 26 00:58 join

Snoble 09:03, 25 October 2007 (MDT) --Stephdl (talk) 21:47, 29 September 2015 (CEST) removed for the moment, not relevant to sme8 and sme9


The Problem

SME will automatically mount connected USB disk drives into the /media folder. Auto-mounting will be performed based both the specific USB port used to connect your drives and the order in which they are connected unless you use another method to specify mount points.

Imagine this example:

  • Connect USB 'A' to your system. It is automatically assigned to /dev/sdc and auto-mounted to /media/usbdisk
  • Disconnect USB 'A' and connect USB 'B' (to the same or to a different USB port). It will be assigned to /dev/sdc and auto-mounted to /media/usbdisk.
  • Re-connect USB 'A' while USB 'B' is still connected, and it will be assigned to /dev/sdd and auto-mounted to /media/usbdisk1.

Or this example:

  • Connect USB 'A' to the second USB port on your SME. It is assigned to /dev/sdc
  • Connect USB 'B' to the first USB port without disconnecting USB 'A'. USB 'B' is assigned to /dev/sdd
  • Leave both drives connected and re-boot. USB 'B' is now connected to /dev/sdc, while USB 'A' is connected to /dev/sdd!

In one case, SME automatically mounted my USB drive in /media/DiskLabel, but, since the resulting automatic entry in /etc/fstab depended on the assigned device, the next drive I connected was also mounted in /media/DiskLabel, even though it had a completely different label!

The Solution

The easiest way to avoid this behavior and provide reliable mount points for your USB drives is to label each drive, then specify the desired mount point in /etc/fstab based on the drive label. This will allow you to:

  • Reliably mount your USB drives to drive-specific directories regardless of what device is assigned to the drive by SME. This would allow you to specify separate USB disks for specific ibays by using lines like these in /etc/fstab:
LABEL=Disk1 /home/e-smith/files/ibays/ibay-1/html ext3 defaults
LABEL=Disk2 /home/e-smith/files/ibays/ibay-2/html ext3 defaults
  • Reliably mount multiple disks in the one location, in case you want to use a rotating set of disk drives for backups, by using lines like these in /etc/fstab (just don't connect two of these drives at the same time!):
LABEL=Disk1 /media/backup ext3 defaults
LABEL=Disk2 /media/backup ext3 defaults
LABEL=Disk3 /media/backup ext3 defaults