LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-25-2007, 01:55 AM   #1
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Rep: Reputation: 30
usb HD vs. usb flashdrive? fstab entry?


I am runnng: #2 in sig, slack-11, 2.6.20 kernel

Having trouble getting fstab to properly differentiate between when a usb hard-drive and a usb flash drive are plugged in... this is the error:

Code:
perry@phargrave:~$ dmesg | tail
sdb: assuming drive cache: write through
SCSI device sdb: 58605120 512-byte hdwr sectors (30006 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 00 00 00
sdb: assuming drive cache: write through
 sdb: sdb1 sdb2 sdb3
sd 2:0:0:0: Attached scsi disk sdb
sd 2:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete
EXT3-fs: Unrecognized mount option "umask=000" or missing value
see that after I plug in the usb HD.

the HD is a working pull from #1 in my sig after an upgrade, 30GB 4200RPM (can't remember the MFG - i can look if needed, some dell junk drive)

I'm pretty sure the trouble lies with my fstab entry:
Code:
/dev/sdb1       /home/usb       auto            users,umask=000 1 0
which works great for usb stick, but not if I plug in this HD where sdb1 is going to be ext3.. is there a workaround for this? Or should I reformat the HD so sbd1 is always vfat?

ps. i tried to get hdparm -I /dev/sdb #and also /dev/sdb1 but:
Code:
/dev/sdb:
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
root@phargrave:/home/perry# hdparm -I /dev/sdb1

/dev/sdb1:
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
root@phargrave:/home/perry# hdparm -I /dev/sdb2
thanks!
 
Old 04-25-2007, 02:26 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Code:
/dev/sdb1       /home/usb       auto            users,umask=000 1 0
Shouldn't that be;
Code:
/dev/sdb1       /home/usb       auto            rw,owner,umask=0000 1 0
But most people are using udev for hotpluggable devices these days.

I seem to recall that if you have rw,owner - or rw,users - you don't actually need the umask.

You could try "ext3,vfat" instead of "auto" too.

Also, isn't "users" a bit redundant (unless more than one person can be logged in at a time)?

The mountpoint is a curious choice - implies you are keeping a home directory on a removable device. One expects /mnt/usb or /media/usb

Last edited by Simon Bridge; 04-25-2007 at 02:28 AM.
 
Old 04-25-2007, 02:40 PM   #3
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
The mount point is indeed a curious one. It implies that usb is the name of a user. If the mount point doesn't exist then it's not going to mount.

I've had similar problems when mounting a usb disk that's formatted as ext2 or ext3. Mount doesn't seem to like the umask option when applied to ext. I find umask is really only useful with FAT partitions.
 
Old 04-25-2007, 06:41 PM   #4
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
i never thought my mountpoint was so odd.. only use that mount point because its convenient, ls ../usb i could move it, if its truly a problem.

i thought all usb flash drives were FAT? thats why I used the umask, but if the rw,users works then I'll try that too.

thank you!
 
Old 04-25-2007, 07:09 PM   #5
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by dracolich
I've had similar problems when mounting a usb disk that's formatted as ext2 or ext3. Mount doesn't seem to like the umask option when applied to ext.
Quote:
Originally Posted by bioe007
thought all usb flash drives were FAT?
You didn't report trouble mounting a flash drive, you reported trouble mounting a usb disk.

Let us know how it goes.
 
Old 04-25-2007, 07:14 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Umask is an option for fat32 and ntfs filesystems. That is because the filesystems don't retain unix ownership and permissions, so these are set as options of the mount command. Different filesystems have different mount options, so refer to the man page for what the options are.

If you insert a pendrive or usb drive and you aren't sure what the filesystem is, you could run "sudo file -s /dev/sdb1" to find out.

Last edited by jschiwal; 04-25-2007 at 07:16 PM.
 
Old 04-25-2007, 10:46 PM   #7
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Simon Bridge
You didn't report trouble mounting a flash drive, you reported trouble mounting a usb disk.
you're right, but the two seem inseperably related by the same /dev/sdb1 fstab entry. what I needed was a clue about what to use for the sdb1 entry.

Quote:
Originally Posted by jschiwal
Umask is an option for fat32 and ntfs filesystems. ... so refer to the man page
didn't know that. And will do; I honestly had a brain fart there and posted this before 'man mount' and 'man fstab' - my apologies

net result-> I changed my fstab entry to:
Code:
/dev/sdb1       /home/usb       auto            rw,users        1 0
which has solved the problem, its now working fine for both my usb-HD and USB flash drives.

sincere gratitude all around, on me
 
Old 04-25-2007, 11:17 PM   #8
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You should not used fstab for removable mediums using USB and IEEE-1394 (aka Firewire or i.Link). I suggest using either use udev, dbus, or hal to automatically mount the drives. I just mount them manually.

It is better to mount a removable drive at any directory instead of /home. The /home directory is where users are located. IMHO, it is more convenient to mount removable drives at some directory in /mnt and setup a symbolic link from your home directory that goes to /mnt.
 
Old 04-25-2007, 11:55 PM   #9
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Electro
You should not used fstab for removable mediums ... use udev, dbus, or hal to automatically mount the drives.
i did not know that.. may I ask why it is bad to use fstab? is it because init will try and mount them?

i will google/LQ search for udev/dbus/hal automounting... (feel free though to *me to any good links )

Quote:
I just mount them manually.
didn't you just tell me to do it automatically?

Quote:
IMHO, it is more convenient to mount removable drives at some directory in /mnt and setup a symbolic link from your home directory that goes to /mnt.
aaah...a much better idea. will do that.

again, thanks for the help!

<edit #1> small progress report..
I have moved all my mounts from /home and made symbolic links, can someone please check my syntax?
Code:
ln -s -t /media/usb1 ~/usb1
it seems to be working fine but is there a more elegant way t do this? not sure if the -t is needed... thanks!

<edit #2> pre-screwing something up question:
so I found this package of scripts, got the source and will begin playing unless I'm barking up the wrong tree...

..get it, source... tree?

Last edited by bioe007; 04-26-2007 at 01:21 AM.
 
Old 05-07-2007, 10:44 AM   #10
dogface2006
LQ Newbie
 
Registered: Jan 2006
Location: Grand Rapids, Mi.
Distribution: Kanotix, Ubuntu Jaunty 9.04, Karmic 9.10, Ubuntu moblin remix
Posts: 28

Rep: Reputation: 15
I use Sidux linux and have not had any problems mounting or unmounting usb HD or SD sticks, seems to automatically take care of that.
 
Old 05-07-2007, 11:57 AM   #11
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Quote:
Originally Posted by bioe007
i did not know that.. may I ask why it is bad to use fstab? is it because init will try and mount them?

i will google/LQ search for udev/dbus/hal automounting... (feel free though to *me to any good links )

didn't you just tell me to do it automatically?


aaah...a much better idea. will do that.

again, thanks for the help!

<edit #1> small progress report..
I have moved all my mounts from /home and made symbolic links, can someone please check my syntax?
Code:
ln -s -t /media/usb1 ~/usb1
it seems to be working fine but is there a more elegant way t do this? not sure if the -t is needed... thanks!

<edit #2> pre-screwing something up question:
so I found this package of scripts, got the source and will begin playing unless I'm barking up the wrong tree...

..get it, source... tree?
USB storage devices can change from one device node and then to the next. Also can be using a different filesystem and/or different partition number. I suggest using HAL or dbus to automatically mount them. If that is too hard, manually mount them yourself. I prefer manually mount them because I have a few drives that uses different fileystems that needs different mount options.
 
Old 05-07-2007, 03:52 PM   #12
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
thanks for the clarification.. I'll have to do some more reading. I have just begun to delve into udev rules for another device.

Thanks for the replies!
perry
 
  


Reply

Tags
flash drive, fstab, pendrive, usb boot



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
usb stick mounts, but fstab entry not right allelopath Linux - Hardware 3 05-08-2006 01:57 PM
USB Device Fstab Entry Campy19 Linux - Hardware 4 01-07-2005 09:34 AM
How to put a permanent entry in fstab for usb pen drive zulfilee Linux - General 4 08-31-2004 11:36 PM
usb fstab entry won't mount r/w Kilka Linux - Hardware 4 07-27-2004 11:05 AM
Mounting USB-Stick - entry in fstab disappears at reboot??? rot Linux - General 5 08-07-2003 03:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:53 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration