don't unmount usb if it in fstab

Bug #690288 reported by J.L.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
usbmount (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: usbmount

don't unmount usb if it in fstab

now

elif [ "$1" = remove ]; then
    # A block or partition device has been removed.
    # Test if it is mounted.
    while read device mountpoint fstype remainder; do
        if [ "$DEVNAME" = "$device" ]; then

need be

elif [ "$1" = remove ]; then

    # Try to use specifications in /etc/fstab first.
    if grep -q "^[[:blank:]]*$UUID" /etc/fstab; then
        log info "executing command: umount -U $UUID"
        umount -U $UUID || log err "umount wan't successful; return code $?"

    elif egrep -q "^[[:blank:]]*$DEVNAME" /etc/fstab; then
        log info "executing command: umount $DEVNAME"
        umount $DEVNAME || log err "umount wan't successful; return code $?"

    else

    # A block or partition device has been removed.
    # Test if it is mounted.
    while read device mountpoint fstype remainder; do
        if [ "$DEVNAME" = "$device" ]; then

    done < /proc/mounts

    fi

Revision history for this message
Rogério Theodoro de Brito (rbrito) wrote : Re: [Bug 690288] [NEW] don't unmount usb if it in fstab

Hi.

On Dec 14 2010, J.L. wrote:
> Binary package hint: usbmount
>
> don't unmount usb if it in fstab

I didn't understand what you tried to say here. Do you mean that usbmount
*doesn't* unmount something if it is listed in fstab or that it *shouldn't*
unmount something listed in fstab?

It is not clear from your description.

BTW, feel free to have your changes against the versions of usbmount at:

    http://git.debian.org/?p=usbmount/usbmount.git

Regards,

--
Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http://rb.doesntexist.org : Packages for LaTeX : algorithms.berlios.de
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

Revision history for this message
J.L. (jl2001) wrote :

*doesn't* unmount something if it is listed in fstab

because in this last version too http://git.debian.org/?p=usbmount/usbmount.git;a=blob_plain;f=usbmount;hb=HEAD I see

elif [ "$1" = remove ]; then

    # A block or partition device has been removed.
    # Test if it is mounted.
    while read device mountpoint fstype remainder; do
 if [ "$DEVNAME" = "$device" ]; then
     # If the mountpoint and filesystem type are maintained by
     # this script, unmount the filesystem.
     if in_list "$mountpoint" "$MOUNTPOINTS" &&
  in_list "$fstype" "$FILESYSTEMS"; then

but "$mountpoint" not in "$MOUNTPOINTS", it mountpoint in fstab and different from default
MOUNTPOINTS="/media/usb0 /media/usb1 /media/usb2 /media/usb3
             /media/usb4 /media/usb5 /media/usb6 /media/usb7"
(from usbmount.conf)

Revision history for this message
J.L. (jl2001) wrote :

when be "add" in this script now write:

if [ "$1" = add ]; then

blablabla

    # Try to use specifications in /etc/fstab first.
    if egrep -q "^[[:blank:]]*$DEVNAME" /etc/fstab; then
 log info "executing command: mount $DEVNAME"
 mount $DEVNAME || log err "mount by DEVNAME wan't successful; return code $?"

    elif grep -q "^[[:blank:]]*UUID=$UUID" /etc/fstab; then
        log info "executing command: mount -U $UUID"
 mount -U $UUID || log err "mount by UUID wan't successful; return code $?"

    else

(and I find old bug here for this part https://bugs.launchpad.net/ubuntu/+source/usbmount/+bug/534532 )

Revision history for this message
Rogério Theodoro de Brito (rbrito) wrote :

I am planning on releasing a new version of usbmount. If you could:

* confirm that you still have problems with the most recent version of usbmount
* take a look in the git repository that I mentioned before and send me a patch

it would be great.

Regards, Rogério Brito.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.