Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

/etc/fstab entry for USB drive

29 views
Skip to first unread message

Maurice Batey

unread,
Jan 9, 2008, 1:54:26 PM1/9/08
to
I'm using a USB drive to both try out new Linux distributions
and now also for backup, but am having difficulty with the
/etc/fstab entries for the two backup partitions /dev/sda1 &
/dev/sda5.

My fstab is:
----------------------------------------------------------
/dev/hdb5 / ext3 relatime 1 1
/dev/hdb7 /home ext3 relatime 1 2
/dev/cdrom /media/cdrom auto
umask=0022,users,iocharset=utf8,noauto,ro,exec 0 0
/dev/cdrom2 /media/cdrom2 auto
umask=0022,users,iocharset=utf8,noauto,ro,exec 0 0
/dev/fd0 /media/floppy auto
umask=0022,users,iocharset=utf8,noauto,exec,flush 0 0
/dev/hda1 /mnt/win_c ntfs umask=0022,nls=utf8,ro 0 0
/dev/hdb1 /mnt/win_c2 vfat umask=0000,iocharset=utf8 0 0
none /proc proc defaults 0 0
/dev/hdb6 swap swap defaults 0 0

/dev/sda1 /mnt/save1 ext3 relatime 0 0
/dev/sda5 /mnt/save2 ext3 relatime 0 0
----------------------------------------------------------

The problem is that at boot time the boot info says "No such
mount point" for both of the sda partitions.

Also, in Storage Media, although the 2 partitions are listed, any
attempt to mount them (even as Root) causes "Permissions Denied".

However, if I go into MCC/Local Disks/Manage Partitions, I can
see that both mount points (/mnt/save1 & /mnt/save2) are shown,
and MCC will mount them, after which I can access the partitions.

What the devil is going on?!

--
/\/\aurice
((Remove 'removethis.' to reply by email)

Maurice Batey

unread,
Jan 9, 2008, 2:41:17 PM1/9/08
to
Belay that! Mysteriously, the partitions in question are now
presented already mounted in Storage Media, without any changes
to fstab...

--
/\/\aurice

Doug Laidlaw

unread,
Jan 9, 2008, 5:40:07 PM1/9/08
to
Maurice Batey wrote:

> Belay that! Mysteriously, the partitions in question are now
> presented already mounted in Storage Media, without any changes
> to fstab...
>

You will find the entries in /etc/mtab...

Doug.

Maurice Batey

unread,
Jan 10, 2008, 11:59:22 AM1/10/08
to
On Thu, 10 Jan 2008 09:40:07 +1100, Doug Laidlaw wrote:

> You will find the entries in /etc/mtab...

Ah, yes; thanks, Doug. All working OK now, but:

The odd thing is, if I want to unmount one of these two, I
have to use a terminal session, because if I try to do it with
Konqueror (right-click, select 'Safely Remove'), I get this
error:
----------------------------------------------------------------
"Unfortunately, the device system:/media/sda5 (/dev/sda5) named
'45G Media' and currently mounted at /media/save2 could not be
unmounted.
Unmounting failed due to the following error:
Device to unmount is not in /media/.hal-mtab so it is not mounted
by HAL"
----------------------------------------------------------------

(N.B. I had changed fstab to use "/media/sdax" rather than
"/mnt/sdax", though that produced the same 'hal' error.)

What is 'hal'? Haven't come across him before...

David W. Hodgins

unread,
Jan 10, 2008, 11:39:10 PM1/10/08
to
On Thu, 10 Jan 2008 11:59:22 -0500, Maurice Batey <mau...@bcs.removethis.org.uk> wrote:

Not sure about the cause of the error. I'll look into that more later.

> What is 'hal'? Haven't come across him before...

HAL stands for Hardware Abstraction Layer. The haldaemon works with a number
of other packages, such as udev to decide what to do, when hardware is detected.

This includes things like creating /dev and /sys symlinks, executing scripts,
keeping track of which device has been assigned which name, etc.

If you look in /etc/undev/rules.d/61-net_config.rules, you'll find a line for
each ethernet card ever found in your system, identified by mac, and which name
has been used, eth0, for example.

In the same dir, in 61-block_config.rules, there's a list of cd/dvd devices found,
which pci address, and which /dev symlinks are assigned to it. A pain, if you move
the cd/dvd from one connector, to another, causing it to become cdrom1, instead of 0.

In /etc/hal/fdi/information, you'll find a list of removable devices, found on
your system.

HAL is one of those helper applications, primarily tying together other applications,
so the system can do things for you, regarding handling hardware. When it works, fine.
When it doesn't, it just adds another layer of things to look at, when trying to
get things working.

If it wasn't so intertwined with the system now, I would prefer to disable it, but
that looks like more trouble than it's worth.

Luckily, for removable devices, hal will not configure the device, if it's already
in /etc/fstab.

I just define everything in fstab, use noauto for removables, turn off all auto
mount/play/etc. and mount/unmount devices myself.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)

Maurice Batey

unread,
Jan 11, 2008, 12:30:44 PM1/11/08
to
On Thu, 10 Jan 2008 23:39:10 -0500, David W. Hodgins wrote:

> In /etc/hal/fdi/information, you'll find a list of removable devices, found on
> your system.

That directory is empty here...

> Luckily, for removable devices, hal will not configure the
device, if it's already in /etc/fstab.

Many thanks for the info, Dave!

David W. Hodgins

unread,
Jan 13, 2008, 8:50:31 PM1/13/08
to
On Thu, 10 Jan 2008 11:59:22 -0500, Maurice Batey <mau...@bcs.removethis.org.uk> wrote:

> Unmounting failed due to the following error:
> Device to unmount is not in /media/.hal-mtab so it is not mounted
> by HAL"

I haven't been able to replicate the above problem, however I have learned a few things,
that may be of interest.

First, the entries in /etc/hal/fdi/information/ only exist, where an option has been
overriden, for a given device. For example, I've stopped hal from polling my cd/dvd
player, looking for a disc insert using

# hal-disable-polling --udi '/org/freedesktop/Hal/devices/storage_model_PIONEER_DVD_RW_DVR_111D'
Polling for drive /dev/hdc have been disabled. The fdi file written was
/etc/hal/fdi/information/media-check-disable-storage_model_PIONEER_DVD_RW_DVR_111D.fdi

I removed all of the files, in the above directory, to start working on getting automount
working again.

First remove any package such as autofs, or pmount, that do automounting, and may interfere
with hal, primarily, by creating fstab entries.

If present, remove the file created by gparted ...
/usr/share/hal/fdi/policy/gparted-disable-automount.fdi
While intended to prevent newly created partitions from being auto mounted "too soon", it
has the effect, of completly disabling all auto mounting. Reboot, or run
"service haldaemon restart".

Remove any fstab entries for the removable devices. Also remove the mount points, from /media.

At this point, when I insert my flash card reader (with a card in it), it automounts, and I've
set kde, to open the filesystem in konqueror.

My usb drive would not automount. After looking through the existing .fdi files, I created
/etc/fdi/policy/my.fdi with
===================================
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- xml -*- -->

<deviceinfo version="0.2">
<device>

<match key="storage.bus" string="usb">
<match key="storage.model" contains="Drive SM_USB20">
<merge key="storage.drive_type" type="string">memory_stick</merge>
</match>
</match>

</device>
</deviceinfo>
===================================

The above file is required, as the model "Drive SM_USB20" is not included in the strings
searched for, in /usr/share/hal/fdi/information/10freedesktop/10-usb-card-readers.fdi

At this point, both the thumb drive and flash card reader automount, and can be unmounted
using media:/, in konqueror.

Note that the mount point used, will be /media/$(filesystem_label).

I won't continue using hal, to automount the devices, as the mount options it's picking
for type vfat (rw,nosuid,nodev,noatime,uhelper=hal,flush,uid=500,utf8,shortname=lower),
are not good. I do not want the flush option, or utf8, and it isn't worth digging for
the method, to change this. This isn't windows. I don't want the system auto mounting
stuff, partitularly, when it's such a pain, to figure out how to control, which options
are used.

To disable hal automounting the devices, I simply run
hal-disable-polling --udi '/org/freedesktop/Hal/devices/storage_serial_Multi_Flash_Reader_058F091111B_0_0'
and
hal-disable-polling --udi '/org/freedesktop/Hal/devices/storage_serial_Flash_Drive_SM_USB20_AA04012700007384_0_0'

The udi strings can be determined by running
lshal |grep info.udi|grep -i usb

I specify the fstab entries myself, such as
/dev/sda1 /mnt/sda1 vfat umask=0,iocharset=iso8859-15,codepage=850,noauto,rw,exec,users 0 0

Maurice Batey

unread,
Jan 14, 2008, 12:52:39 PM1/14/08
to
On Sun, 13 Jan 2008 20:50:31 -0500, David W. Hodgins wrote:

> I have learned a few things, that may be of interest.

Yes, indeed! Many thanks, Dave...

0 new messages