Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: judgej on July 23, 2006, 11:52:06 PM

Title: Confused about mounting USB drives
Post by: judgej on July 23, 2006, 11:52:06 PM
I'm a little confused about how USB drives are supposed to be mounted in SME 7.

The backup2 utility requires an entry in /etc/mstab. This allows the serial device to be easily mounted to a pre-determined place, for example:

/dev/sda1 -> /media/usbdisk

Now, if there happens not to be a valid USB drive at /dev/sda1 (it may be turned off, or it may have been plugged into a different USB socket) then the server will refuse to boot. That is obviously a bit of a disaster, and means having to go into the recovery console and deleting that line from /etc/fstab.

So - how should I be dealing with this? Is there supposed to be something running on the server that checks these devices and regenerates the /etc/fstab file. It is templated after all. I assume manually altering this file is the wrong thing to do (since it is templated). Yet, *somewhere* I need to specify exactly where a USB drive gets mounted by default.

I also find that the USB drive occasionally shifts between devices - /dev/sda one boot and /dev/sdb on the next boot. What is that about, and how should I be dealing with that?

I've read all the howtos and instructions, and they all seem to skirt over this issue, as though the correct entries in /etc/fstab magically appear. Perhaps they should, and it is my server that is not working? I just don't know.

I am reluctant to raise this as a bug until I know how it is supposed to work.

Thanks,

-- JJ
Title: Re: Confused about mounting USB drives
Post by: judgej on July 24, 2006, 12:50:17 AM
Doing some research, "mounting disks using labels" looks like a promising lead.
Title: Re: Confused about mounting USB drives
Post by: judgej on July 24, 2006, 02:18:34 AM
I gave my big (250G) USB backup disk a label "backup2", and added this line to /etc/fstab:

Code: [Select]
LABEL=backup2 /media/usbdisk ext3 noauto,user,owner,pamconsole 0 0

Now it does not matter which USB it is plugged into, or even whether it is turned on or not, it is possible to mount and unmount that disk to the same place each time.

I appreciate this will get overwritten next time the template is expanded, when changing the quota settings for example, but I can add a custom template to handle it. What I still don't understand is how other people get away with using backup2, to USB drives, without having to touch the fstab file, and without having to manually mess about mounting drives. Am I missing something?

Next thing to work out how to do: powering down the USB drive when it is unmounted, or at least spining it up/down from the backup2 script. That way I can leave it plugged in all the time, without it using too much power and wearing out, and being noisy.

-- JJ
Title: USB File System
Post by: steveo on July 24, 2006, 11:29:12 PM
I would like to know how to change the USB file system. The line in FSTAB reads:

Code: [Select]
/dev/sda1  /media/usbdisk vfat pamconsole,exec,noauto,managed 0 0

I would like to change it to ext3, but I don't know where the templates obtain the vfat value. I have changed the value in /etc/fstab, its retained when I expand the template, but it does change back to vfat.

How do I set the usbdisk to be ext3?

Thanks,
Title: Re: Confused about mounting USB drives
Post by: CharlieBrady on July 25, 2006, 04:52:21 AM
Quote from: "judgej"
I'm a little confused about how USB drives are supposed to be mounted in SME 7.


SME7 has no specific support for USB drives. Whatever works with RHEL4/CentOS should also work with SME7.
Title: usb hdd
Post by: vesnick on July 29, 2006, 12:05:22 PM
Hi Guys

I used this to get it up and running from mr Darrell May. ( thanks Darrell !)

http://forums.contribs.org/index.php?topic=29872.0


Works well for my home seerver after I installed the USB2 card.

Hope this helps
Nick
Title: Re: usb hdd
Post by: judgej on July 29, 2006, 12:29:27 PM
Quote from: "vesnick"
Hi Guys

I used this to get it up and running from mr Darrell May. ( thanks Darrell !)

http://forums.contribs.org/index.php?topic=29872.0



Yes, that's the one I tried. The first problem I hit was that the fdisk commands were slightly different (not sure if it changed in SME7.0 final). But the main problem, as I highlighted in the original post, is the point at which the USB entries 'magically' appear in /etc/fstab - how do they get in there? I suspect it is something to do with "fstab-sync", and perhaps that is not working for me...?

-- JJ