LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2007, 06:45 PM   #1
emeut
LQ Newbie
 
Registered: Jul 2007
Posts: 15

Rep: Reputation: 0
manualy mount usb device not in fstab


Hi

I am running Mandriva one 2007 on a P3 933 system 256 mb ram.
If i use the GUI i can mount and unmount my drive (WD Passport 120 gb) without problem.I prefer to know the command and use a term window as i used to do with dos, but there seems to be something i don't do properly.

1) Looking at fstab and mtab in /etc i do not not see /dev/sda1 normaly monted on /media. if i do a ls on /media i see floppy,and my 2 cdrom (witch are part of fstab)
2) At this point i can see with the GUI (icone Devices) that my drive is seen but not mounted. If i click on the device icone, the system mounts the device i am able to see the info on the disk.
typing more /etc/mtab i see than my dev/sda1 is now part of /etc/mtab but still not part of /etc/fstab.

However if i try to mount the drive manualy i get the following error message
mount: can't find /dev/sda1 in /etc/fstab or /etc/mtab

Could someone explain what step the GUI does to include my drive in /etc/mtab or direct me to some useful doc or tutorial on the subject.


Tanks for your assistance
emeut
 
Old 10-14-2007, 06:50 PM   #2
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Rep: Reputation: 34
try inserting again your usb hd BUT before doing that.. prepare /var/log/messages and paste the output here. . we had the similar situations. but now i was able to made it. one suggestion try changing your usb cable. i change mine into the shortest cable included in my enclosure. .
 
Old 10-14-2007, 07:26 PM   #3
emeut
LQ Newbie
 
Registered: Jul 2007
Posts: 15

Original Poster
Rep: Reputation: 0
manualy mount usb device not in fstab

Thanks IC TORRES for your reply.

My usb setup is as follow, it may or may not be relevant.

from my comp: a standard 3 feet usb cable going to a dynamic hub (4 port)
and from my hub a one foot conversion cable from 6 to 4 pins.

Following is the output of my /var/log/messages file

Oct 14 20:11:03 933_linux last message repeated 3 times
Oct 14 20:13:25 933_linux kernel: usb 1-1.2: new full speed USB device using uhci_hcd and address 6
Oct 14 20:13:25 933_linux kernel: usb 1-1.2: configuration #1 chosen from 1 choice
Oct 14 20:13:25 933_linux kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Oct 14 20:13:30 933_linux kernel: Vendor: WD Model: 1200BEVExternal Rev: 1.02
Oct 14 20:13:30 933_linux kernel: Type: Direct-Access ANSI SCSI revision: 00
Oct 14 20:13:30 933_linux kernel: SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)
Oct 14 20:13:30 933_linux kernel: sda: Write Protect is off
Oct 14 20:13:30 933_linux kernel: sda: assuming drive cache: write through
Oct 14 20:13:30 933_linux kernel: SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)
Oct 14 20:13:30 933_linux kernel: sda: Write Protect is off
Oct 14 20:13:30 933_linux kernel: sda: assuming drive cache: write through
Oct 14 20:13:30 933_linux kernel: sda: sda1
Oct 14 20:13:30 933_linux kernel: sd 3:0:0:0: Attached scsi disk sda
Oct 14 20:13:30 933_linux kernel: sd 3:0:0:0: Attached scsi generic sg0 type 0
Oct 14 20:13:36 933_linux kernel: end_request: I/O error, dev fd0, sector 0
Oct 14 20:13:36 933_linux kernel: end_request: I/O error, dev fd0, sector 0
Oct 14 20:13:50 933_linux hald: mounted /dev/sda1 on behalf of uid 500
Oct 14 20:13:51 933_linux kernel: end_request: I/O error, dev fd0, sector 0

i am curious about the error reported do you know what it means since i can read and write easely on the disk using the Gui or cd to it via term and copy files.
tks
 
Old 10-14-2007, 07:51 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You may not have unmounted the drive properly the last time you used it. The file system may be corrupt.

You can run "sudo /sbin/fsck.vfat /dev/sda1" on it (assuming it is assigned the same device).

Or if the filesystem is OK and you can mount it graphically, do so. Then either enter "mount" by itself, or examine the contents of /etc/mtab. Both will list how it is mounted and the options used.

You didn't post what the mount command was that you tried. You may not have had the mountpoint created or didn't include the filesystem or device or options.

I would recommend connecting the drive, and (if it is assigned to /dev/sda1 again) entering: udevinfo -q env -n /dev/sda1
This will give you information about the UUID of the filesystem and the filesystem label if it has on. Use one of them instead of the device name for removable drives.
Here is an example using a pendrive:
[code]
Oct 14 19:41:02 hpamd64 hald: mounted /dev/sdc1 on behalf of uid 1000

From mount output:
/dev/sdc1 on /media/disk type vfat (rw,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower)

udevinfo -q env -n /dev/sdc1
DEVTYPE=partition
ID_VENDOR=SanDisk
ID_MODEL=Cruzer_Mini
ID_REVISION=0.2
ID_SERIAL=SanDisk_Cruzer_Mini_20043513231b2c9119ad-0:0
ID_SERIAL_SHORT=20043513231b2c9119ad
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
ID_PATH=pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
ID_FS_UUID_ENC=3B69-1AFD
ID_FS_LABEL=
ID_FS_LABEL_ENC=
ID_FS_LABEL_SAFE=

The filesystem doesn't have a label, so I could either label it or use the unique filesytem id (UUID) in /etc/fstab
I'll just make one up here, taking the easy way by copying the same options that the auto mount system used:
UUID=3B69-1AFD /media/pendrive vfat rw,noauto,user,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower 0 0

You could use your username instead of your UID in the uid= option. You can also finetune the permissions with the fmask and dmask options. See the "mount" man page for details. The /media/pendrive would have to be created. Note the "user" option. This would allow me to mount it without having to use sudo. If this drive is normally connected, you could even add a "mount /media/pendrive" to your .profile or .bash_profile files so that it is mounted when you login.

good luck!
 
Old 10-14-2007, 11:01 PM   #5
emeut
LQ Newbie
 
Registered: Jul 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Hi

I was able to mount my drive correctly using command line
(mount /dev/sda1 /media)
My problem was a lack of mount point in the command...

just want to say tanks to all the people who help on these forums and hopefully i will be able to do the same eventually

tanks for your help
emeut
 
  


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 set mount and /etc/fstab for usb HD dtconnor Linux - Hardware 13 02-18-2007 05:47 PM
USB storage/camera device fstab help munkie_poo Linux - Hardware 1 03-15-2005 10:22 AM
USB Device Fstab Entry Campy19 Linux - Hardware 4 01-07-2005 09:34 AM
usb fstab entry won't mount r/w Kilka Linux - Hardware 4 07-27-2004 11:05 AM
how can I mount this device: da0: <USB 2.0 Storage Device alkad_mzu *BSD 2 11-15-2003 06:15 PM


All times are GMT -5. The time now is 07:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration