LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   some USBstick help please (https://www.linuxquestions.org/questions/linux-general-1/some-usbstick-help-please-345786/)

Lleb_KCir 07-22-2005 02:52 PM

some USBstick help please
 
well followed the HOWTO on this site and it worked perfectly for my laptop, but not for my gaming box.

both are running the 2.6.x kernels.

here is my dmesg about the usb stick:

Code:

usb 1-2: new high speed USB device using ehci_hcd and address 3
scsi2 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
  Vendor:          Model: USB Flash Memory  Rev: 1.00
  Type:  Direct-Access                      ANSI SCSI revision: 02
SCSI device sdc: 2002944 512-byte hdwr sectors (1026 MB)
sdc: assuming Write Enabled
sdc: assuming drive cache: write through
SCSI device sdc: 2002944 512-byte hdwr sectors (1026 MB)
sdc: assuming Write Enabled
sdc: assuming drive cache: write through
 /dev/scsi/host2/bus0/target0/lun0: p1
Attached scsi removable disk sdc at scsi2, channel 0, id 0, lun 0
Attached scsi generic sg2 at scsi2, channel 0, id 0, lun 0,  type 0
usb-storage: device scan complete

so it is detected, and if i read this correctly it is placed on sdc(i am guessing 0) so i made a line in my fstab look like the following:

Code:

/dev/sdc1      /mnt/camera    auto    defaults,user,noauto    0      0
/dev/sdc2      /mnt/USBdrive  auto    user,rw,auto    0      0

had to put it on 2 as i already have my USB camera on 1. is this right or wrong? i have tried noauto in the user,rw,auto and still get the same 2 errors:

as user i get the following:

Code:

$ mount /mnt/USBdrive/
mount: I could not determine the filesystem type, and none was specified
ray@p4ssmahome:~$ mount -t vfat /mnt/USBdrive/
mount: only root can do that

so as root i try to mount it and get the following:
Code:

$ su -
Password:
p4ssmahome:~# mount /mnt/USBdrive/
mount: you must specify the filesystem type
p4ssmahome:~# mount -t vfat /mnt/USBdrive/
Usage: mount -V                : print version
      mount -h                : print this help
      mount                    : list mounted filesystems
      mount -l                : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
      mount -a [-t|-O] ...    : mount all stuff from /etc/fstab
      mount device            : mount device at the known place
      mount directory          : mount known device here
      mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
      mount --bind olddir newdir
or move a subtree:
      mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .

ok so what is going on?

kencaz 07-22-2005 03:19 PM

Assuming you have the correct device sdc2, root would mount like this:

# mount -t vfat /dev/sdc2 /mnt/USBdrive/

KC

Lleb_KCir 07-22-2005 03:32 PM

ok i see what root was doing wrong, but why on my laptop can user mount /mnt/USBstick and be done with it?

i would like user to be able to mount and umount that device.

kencaz 07-22-2005 03:39 PM

Well, if you were able to mount ok using vfat as root then replace "auto" with "vfat" in your fstab then user should be able to mount without fs type error...

KC

Lleb_KCir 07-22-2005 03:42 PM

ok that works, can you explain why when the fstab on both the laptop and game box (basically the same except the sdx part) i do not need a file type on the laptop, but do on the game box?

kencaz 07-22-2005 03:48 PM

Good question... If they both have the same distro then its probably a kernel issue with the file system detection... Beyond guessing, I would have to reasearch a little more on that...

KC

Lleb_KCir 07-22-2005 03:58 PM

ok, one is 2.6.9, other is 2.6.11, both are debian.

Lleb_KCir 07-23-2005 05:45 PM

well that did not work:

Code:

ray@p4ssmahome:~$ mount -t vfat /dev/sdc2 /mnt/USBdrive/
mount: only root can do that
ray@p4ssmahome:~$ su -
Password:
p4ssmahome:~# mount -t vfat /dev/sdc2 /mnt/USBdrive/
mount: /dev/sdc2 is not a valid block device
p4ssmahome:~#

*sad*

Lleb_KCir 07-23-2005 05:49 PM

fixed it. changed the sdc2 to sdc1 and it now works for both root and user the same way it does on the laptop.

oneandoneis2 07-24-2005 05:00 AM

Yep. You were defeated by a misunderstanding of the naming convention :)

sdc means the third SCSI disc detected by the system. sdc1 is the first partition on the disk, sdc2 the second partition on the same disk.

So if you plug in your camera, it'll be sdc, and its first partition sdc1

If you then plug in your flash disk, it'll be sdd with the first partition sdd1, as sdc already exists

But if you unplug your camera and THEN plug in the flash disc, it will then be sdc

It's a logical enough system, but it can be annoying if you always want a piece of hardware to have the same name, rather than it depending on what order you plug things in.

You can set up udev so that hardware will always have the same /dev address no matter when you plug it in, should you feel the need.

Lleb_KCir 07-24-2005 11:20 AM

ahh ok, now i understand exactly what was going on. thank you for that tidbit of info. very kewl to learn from mistakes and even better to learn WHY.

Lleb_KCir 07-26-2005 12:00 AM

ok next question. on my game box with the sdc1, what if i wanted to mount both my USB stick and my USB camera at the same time?

can i add a duplicate line in my /etc/fstab and just replace the 1 with a 2 for both devices so i can mount both or either and not worry about it?

oneandoneis2 07-26-2005 02:36 AM

Yep, but you'd want to change sdc1 to sdd1, not sdc2. . .

Lleb_KCir 07-26-2005 12:13 PM

Quote:

Originally posted by oneandoneis2
Yep, but you'd want to change sdc1 to sdd1, not sdc2. . .
ok so i would want my /etc/fstab to look like:

Code:

/dev/sdc1      /mnt/camera    auto    defaults,user,noauto    0      0
/dev/sdc1      /mnt/USBdrive  auto    user,rw,auto    0      0

/dev/sdd1      /mnt/camera    auto    defaults,user,noauto    0      0
/dev/sdd1      /mnt/USBdrive  auto    user,rw,auto    0      0

and that would not mess anything up, and alow me to mount them single, or mount them together.


All times are GMT -5. The time now is 09:50 AM.