LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 03-13-2009, 08:39 PM   #1
LordFrancis
Member
 
Registered: Sep 2004
Location: Victoria, BC
Distribution: debian testing
Posts: 53

Rep: Reputation: 15
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
 
Old 03-14-2009, 11:34 AM   #2
puntjuh
Member
 
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 41
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.
 
Old 03-15-2009, 12:46 PM   #3
LordFrancis
Member
 
Registered: Sep 2004
Location: Victoria, BC
Distribution: debian testing
Posts: 53

Original Poster
Rep: Reputation: 15
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, ...".
 
Old 03-15-2009, 01:16 PM   #4
puntjuh
Member
 
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 41
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.
 
Old 03-15-2009, 01:49 PM   #5
LordFrancis
Member
 
Registered: Sep 2004
Location: Victoria, BC
Distribution: debian testing
Posts: 53

Original Poster
Rep: Reputation: 15
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
 
Old 03-15-2009, 02:05 PM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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
 
Old 03-15-2009, 03:19 PM   #7
LordFrancis
Member
 
Registered: Sep 2004
Location: Victoria, BC
Distribution: debian testing
Posts: 53

Original Poster
Rep: Reputation: 15
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.

Last edited by LordFrancis; 03-15-2009 at 03:26 PM. Reason: update
 
Old 03-17-2009, 04:18 AM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.

Last edited by jschiwal; 03-17-2009 at 08:57 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to poll for USB devices available to mount (with auto-mounting disabled)? tl3462 Linux - Hardware 5 01-29-2009 08:49 AM
devices in /etc/fstab don't auto mount at startup : jabka Linux - General 3 08-23-2006 03:28 PM
(auto)mounting devices in slackware w/ (or w/o) KDE crisostomo_enrico Slackware 1 08-04-2006 11:59 PM
how can i configure FreeBSD to auto mount USB devices? asilentmurmur *BSD 2 04-24-2006 01:24 PM
Auto mounting of USB devices leecming Linux - Newbie 6 08-05-2004 01:42 PM


All times are GMT -5. The time now is 12:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration