KDE mounted devices sometimes do not clean /media"

When booting opensuse 11.2 or 11.3 there is automatically created a folder in /media to mount my external usb drive (in /media/disk).

The problem I have is that sometimes these folders are not automatically removed when I shut down. On the next time boot this device is mounted at /media/disk-1 or /media/disk-2 which throws off for instance Krusader or Amarok. Also the folders that are not removed seem to have really strong permissions such that I can’t even browse into them in Krusader or Dolphin. I have to manually clean the /media folder as super user so that when I reboot, they are in /media/disk.

Does anyone know how to ensure that opensuse removes the folder(s) upon shutdown?

cloggers wrote:
> When booting opensuse 11.2 or 11.3 there is automatically created a
> folder in /media to mount my external usb drive (in /media/disk).

how is that done? i guess with a fstab entry, so please show us the
output of


cat /etc/fstab

> The problem I have is that sometimes these folders are not
> automatically removed when I shut down.

you say ‘sometimes’…what is different?

are you dual booting to some other operating system (which), and do
the folders always work correctly unless you boot:

openSUSE then Windows then openSUSE again
or
openSUSE then Ubuntu then Windows again
or or or what?

> On the next time boot this
> device is mounted at /media/disk-1 or /media/disk-2 which throws off for
> instance Krusader or Amarok. Also the folders that are not removed seem
> to have really strong permissions such that I can’t even browse into
> them in Krusader or Dolphin. I have to manually clean the /media folder
> as super user so that when I reboot, they are in /media/disk.

do you do that cleaning?

i mean, do you pop open a command line interface, become root and
issue some command like rm /blah/blah

or, do you open krusader/dolphin in root/su mode, or log directly into
KDE as root, or what?

> Does anyone know how to ensure that opensuse removes the folder(s) upon
> shutdown?

how are they being ‘removed’ now, do you run a script, or what?

might be able to figure out why yours is not working as it should,
when we figure out what might be going on there which is not as it
should be


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

I can confirm this…

In Gnome this is not observed. In KDE is necessary unmount the device before log out.

OS: Opensuse 11.3 x64
KDE4.5

Any ideas?

jadigo

I can confirm this…

In Gnome this is not observed. In KDE is necessary unmount the device before log out.

OS: Opensuse 11.3 x64
KDE4.5

Any ideas?

jadigo

AFAIR the system creates hidden lock file (.hal-mtab.lock or something like that) in the /mount directory, that reserves the name (disk, disk-1, etc.) while it is mounted, obviously to avoid duplication. If the device is not removed correctly the lock is not removed, so when the device is inserted again the name-numbering is increased. If you manually remove the lock file(s) it should work again.

Mind you, this is so in OS 11.1 and 2, I think. Not sure about 11.3.

Contrary to what was posted above, the device will not show in fstab, unless you explicitly put it there. Removable devices are dynamically added/removed in /etc/mtab, they never show up in fstab, this is for “fixed” devices only - internal hard disks, network shares, special system files and such.

On 08/29/2010 10:36 AM, jdiazgon wrote:
>
> Any ideas?

Yes, always unmount any automounted devices. It is good practice and might save
the file system on the device.

As poster brunomcl pointed out there is no entry for this device in /etc/fstab.

“If the device is not removed correctly the lock is not removed”.
But I noticed a .hal-mtab-lock file in the /media directory that remained even after I correctly unmounted the drive.

The question is why is the lock or the media/disk directory not removed upon powerdown of the computer. Unmount the drive before powerdown is certainly a solution but easily forgotten.

brunomcl wrote:
> Contrary to what was posted above, the device will not show in fstab,
> unless you explicitly put it there.

perhaps i am confused, but that is exactly why i asked how this was
being accomplished “When booting opensuse 11.2 or 11.3 there is
automatically created a folder in /media”

some folks plug in one or more drives via USB and leave them plugged
in, and fix the name and place via fstab so that it is always the
same (so that for instance Krusader or Amarok can always find the
music)…some folks call that auto-mounting, some folks call it
automatically mounting…

> Removable devices are dynamically
> added/removed in /etc/mtab, they never show up in fstab, this is for
> “fixed” devices only - internal hard disks, network shares, special
> system files and such.

sorry, you are incorrect…fstab is for “fixed devices” AND removable
devices which the user wants to insure is always identified the same
way by the system…

or has that changed?


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

A lot of people seem to add an entry for their USB drives in fstab.
AFAIK this not a preferred solution however it would possibly solve my problem. My drive is permanently connected to my pc.
But would my USB drive be correctly unmounted by opensuse ??

cloggers wrote:
> A lot of people seem to add an entry for their USB drives in fstab.
> AFAIK this not a preferred solution however it would possibly solve my
> problem.

WELL, if you want to walk up to a running Linux computer and plug in a
USB drive then HAL senses it being plugged in and mounts it…easy
peasy…but it might be mounted as /media/disk-1 today and something
else tomorrow…SO you must do something to help that…

and as far as i recall you do NOT solve that problem in
fstab…because if the drive is listed in fstab and it is NOT
connected when you boot you get a fat error/complaint…and HAL will
not correctly sense and handle the drive for AUTO-CONNECT if it is
listed in fstab

but, that is NOT your case!

> My drive is permanently connected to my pc.
> But would my USB drive be correctly unmounted by opensuse ??

in your case, you want it to boot with USBs connected and have them
always put them in the same place with the same name—THAT you do in
fstab…(it can NOT be done reliably by HAL, as you can attest…maybe
next week it can be, or maybe not…)

and, if you do the fstab thing correctly it should (not sure i can say
will) correctly unmount ALL drives at shutdown, no matter if they are
on the IDE bus, or the SATA bus, or the USB bus, or the bus downtown :slight_smile:

there are a multitude of previous threads here on how to enter USB
drive info into the fstab, but my googleFU is a little weak at the
moment…

here is one good place to begin:
http://en.opensuse.org/SDB:Basics_of_partitions,_filesystems,_mount_points
search for USB…but do NOT ignore all the background you may need,
which comes before that section…

if i recall correctly the info from your /etc/mtab can fairly easily
be adapted and added to fstab…but, be sure and READ ‘man fstab’ to
follow all the rules…

there are more hints and tips in the wiki or forum, i just can’t seem
to find them now…

BACK UP! before you do a lot of futzing around…


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]