LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   KDE fails to auto mount usb devices (http://www.linuxquestions.org/questions/linux-desktop-74/kde-fails-to-auto-mount-usb-devices-711484/)

LordFrancis 03-13-2009 08:39 PM

KDE fails to auto mount usb devices
 
Hello

for the past while I've been having problems mounting usb storage devices in KDE.

Whenever I plug in a usb pen, KDE comes up with a dialog asking me whether I want to mount it or do nothing. If I choose to mount it, it takes me to system:/media/sdb1 and returns
Quote:

mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error. In some cases useful info is found in syslog - try dmesg | tail or so.
Alright. dmesg has the following information, which looks fine to me:
Code:

usb 3-6: new high speed USB device using ehci_hcd and address 4
usb 3-6: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi4 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
scsi 4:0:0:0: Direct-Access    LEXAR    JUMPDRIVE PRO    0    PQ: 0 ANSI: 2
sd 4:0:0:0: [sdb] 503808 512-byte hardware sectors (258 MB)
sd 4:0:0:0: [sdb] Write Protect is off
sd 4:0:0:0: [sdb] Mode Sense: 6b 00 00 00
sd 4:0:0:0: [sdb] Assuming drive cache: write through
sd 4:0:0:0: [sdb] 503808 512-byte hardware sectors (258 MB)
sd 4:0:0:0: [sdb] Write Protect is off
sd 4:0:0:0: [sdb] Mode Sense: 6b 00 00 00
sd 4:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 4:0:0:0: [sdb] Attached SCSI removable disk
sd 4:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete

If from system:/media/sdb1 I move up one level to system:/media/ I get the error
Quote:

The process for the media protocol died unexpectedly.
However, I manage to mount the usb pen, as root, without errors with
Code:

mount -t vfat /dev/sdb1 /media/folder/
I googled this and found little bits of information here and there. I reinstalled pmount, kdebase-kio-plugins, and udev but nothing changed. My user is in the plugdev group.

My laptop also has a card reader, and if I stick an SD card in it, KDE manages to mount it flawlessly.

How do I get KDE to mount USBs again?


I'm running Debian Lenny on a 2.6.27.5 kernel.


Thanks

puntjuh 03-14-2009 11:34 AM

In this case it would seem there are some mistakes in /etc/fstab. Please post your fstab file, which holds all data to what is beeing booted, and with what permissions, and such.

LordFrancis 03-15-2009 12:46 PM

Code:

# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
/dev/sda1      /              ext3    defaults,errors=remount-ro 0      1
/dev/sda5      none            swap    sw              0      0
/dev/hda        /media/scd0    udf,iso9660 user,noauto    0      0
/dev/sdb1      /media/tb      fuse.ntfs user,noauto,locale=en_CA.UTF8 0      0

I had forgotten about the last line!
When I saw it I wanted to test whether I can mount usb pens when that external HD is plugged in (and seen as sdb1). It didn't work.

Just as before, system:/media/sdb1 comes up and is empty. If I go one level up, the media protocol _won't_ crash, but if I click on the external HD icon, it will return the mount error "mount: wrong fs type, bad option, ...".

puntjuh 03-15-2009 01:16 PM

The problem here might be the filesystem you want it to use for your USB stick. Your usb stick probably isn't formatted as NTFS. What fstab is trying to do at the moment is mounting a NTFS filesystem, which is not possible as your USB stick is formatted as fat.

I'd try changing the file type either to vfat, but then you'll have to change it if back to ntfs again each time u want to mount your external HD. So i'd try "auto" as file system.

LordFrancis 03-15-2009 01:49 PM

True. The USB pens are formatted with various FAT filesystems, while the external HD is ntfs.
If I specify the fs for sdb1 as auto, I don't think it would recognise and mount the ntfs HD, since it has to use ntfsmount from ntfsprogs instead of mount to mount it.

That was the reason why I originally put that line in the file. :/

How can I go about still managing to mount usb pens as a user from KDE and also easily mounting the ntfs HD?

Thanks

jschiwal 03-15-2009 02:05 PM

Use "UUID=<UUID#>" in the /etc/fstab entry instead. AFAIK, if you want KDE to automount a pendrive, there shouldn't be an entry for it in fstab. This is true for SuSE at least. A kernel message will say that HAL refuses to mount it.

Also, try mounting the pendrive manually. Is it properly formatted? I saw /dev/sdb but not /dev/sdb1 in the kernel messages. Was the entire filesystem formatted?

Here I mounted a 2GB pen drive:
Code:

    1  Mar 15 13:55:20 qosmio kernel: usb 5-1: reset high speed USB device using ehci_hcd and address 2
    2  Mar 15 13:55:20 qosmio kernel: usb 5-1.4: new high speed USB device using ehci_hcd and address 4
    3  Mar 15 13:55:20 qosmio kernel: usb 5-1.4: configuration #1 chosen from 1 choice
    4  Mar 15 13:55:20 qosmio kernel: usb 5-1.4: New USB device found, idVendor=0930, idProduct=6544
    5  Mar 15 13:55:20 qosmio kernel: usb 5-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    6  Mar 15 13:55:20 qosmio kernel: usb 5-1.4: Product: USB Flash Memory
    7  Mar 15 13:55:20 qosmio kernel: usb 5-1.4: Manufacturer:
    8  Mar 15 13:55:20 qosmio kernel: usb 5-1.4: SerialNumber: 0802212145123
    9  Mar 15 13:55:21 qosmio kernel: Initializing USB Mass Storage driver...
    10  Mar 15 13:55:21 qosmio kernel: scsi6 : SCSI emulation for USB Mass Storage devices
    11  Mar 15 13:55:21 qosmio kernel: usbcore: registered new interface driver usb-storage
    12  Mar 15 13:55:21 qosmio kernel: USB Mass Storage support registered.
    13  Mar 15 13:55:21 qosmio kernel: usb-storage: device found at 4
    14  Mar 15 13:55:21 qosmio kernel: usb-storage: waiting for device to settle before scanning
    15  Mar 15 13:55:22 qosmio kernel: scsi 6:0:0:0: Direct-Access              USB Flash Memory 1.00 PQ: 0 ANSI: 2
    16  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] 3946367 512-byte hardware sectors: (2.02GB/1.88GiB)
    17  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] Write Protect is off
    18  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] Mode Sense: 0b 00 00 08
    19  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through
    20  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] 3946367 512-byte hardware sectors: (2.02GB/1.88GiB)
    21  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] Write Protect is off
    22  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] Mode Sense: 0b 00 00 08
    23  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through
    24  Mar 15 13:55:22 qosmio kernel:  sdc: sdc1
    25  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: [sdc] Attached SCSI removable disk
    26  Mar 15 13:55:22 qosmio kernel: sd 6:0:0:0: Attached scsi generic sg3 type 0
    27  Mar 15 13:55:22 qosmio kernel: usb-storage: device scan complete
    28  Mar 15 13:55:23 qosmio hald: mounted /dev/sdc1 on behalf of uid 1000

Note lines 24-28.

Here is one way to determine the UUID of your NTFS partition:
Code:

ls -l /dev/disk/by-uuid/ | grep sda2
lrwxrwxrwx 1 root root 10 2009-03-14 00:47 145266D35266B95E -> ../../sda2

Use the correct device node. I just used 'grep' to shorten the list.
In /etc/fstab could use a line like:
Code:

UUID=145266D35266B95E  /mnt/vista      ntfs    rw,user,fmask=117,dmask=007,uid=jschiwal,gid=jschiwal 0 0
Use this technique for all external partitions. You might consider it for others as well. That way, if you repartition your internal hard drive, and the device nodes change as a result, the /etc/fstab entries will still be valid.

You can check the pendrive with fdisk & file:
sudo /sbin/fdisk -l /dev/sdb
sudo file -s /dev/sdb
sudo file -s /dev/sdb1

LordFrancis 03-15-2009 03:19 PM

I changed my fstab so that instead of pointing to /dev/sdb1 I point to the UUID:
Code:

UUID=6288A4DA88A4AE4B  /media/tb      fuse.ntfs      rw,user,noauto,locale=en_CA.UTF8        0      0
Now, whenever I try to mount the external HD with KDE (in system:/media/) I get a "Permission denied" error. I thought I had the right options in fstab, am I right?

With ntfsmount from command line I can mount the HD as user.

jschiwal 03-17-2009 04:18 AM

Don't use the /media/ directory for manually mounted partitions. /media is for auto mounted media if your system uses HAL. Is the NTFS drive external or internal. If it is internal, then remove the "noauto" option and it will be mounted when you boot up.

If it is an internal disk, then you can comment out the /etc/fstab entry and rely on automounting to mount it. Or (supposing you change /media/tb to /mnt/tb) you can enter: "mount /mnt/tb" as a regular user.


All times are GMT -5. The time now is 01:48 AM.