LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   cant detect usb flash drive (https://www.linuxquestions.org/questions/suse-opensuse-60/cant-detect-usb-flash-drive-481137/)

micro_xii 09-07-2006 12:02 AM

cant detect usb flash drive
 
Greetings to all.

Newbie here.

In this forum i follow the steps:

cat /proc/partitions
8 0 35548320 sda
8 1 1052226 sda1
8 2 34491555 sda2
8 16 71687000 sdb
8 17 1052226 sdb1
8 18 70621740 sdb2
8 32 35548320 sdc
8 33 1052226 sdc1
8 34 34491555 sdc2
8 80 122879 sdf---->my usb.it changes when i plug /unplug.

mkdir /mnt/usb
mount /dev/sdf /mnt/usb

it works fine..temporarily.I want it to be permanent and computer will detect it automatically.....in the forum it says something about /etc/fstab...........i mean whats next..when i command this it says
permission denied...but i logon as a root.Can anyone show the complete command...newbie here

Thomas Lemmens 09-07-2006 03:58 AM

Quote:

Originally Posted by micro_xii
Greetings to all.

Newbie here.

In this forum i follow the steps:

cat /proc/partitions
8 0 35548320 sda
8 1 1052226 sda1
8 2 34491555 sda2
8 16 71687000 sdb
8 17 1052226 sdb1
8 18 70621740 sdb2
8 32 35548320 sdc
8 33 1052226 sdc1
8 34 34491555 sdc2
8 80 122879 sdf---->my usb.it changes when i plug /unplug.

mkdir /mnt/usb
mount /dev/sdf /mnt/usb

it works fine..temporarily.I want it to be permanent and computer will detect it automatically.....in the forum it says something about /etc/fstab...........i mean whats next..when i command this it says
permission denied...but i logon as a root.Can anyone show the complete command...newbie here

What distribution are you running on your pc? What brand is your usb-stick?
I am working on opensuse 10.1 64bit and my usb-stick (brand: imation) is automatically detected on insert and opened in Nautilus (filemanager of gnome desktop). And when I rightclick on the desktop-icon there is a popupmenu with an option to unmount the volume. In proc/partitions you can see that two devices are activated by inserting the stick: sde AND sde1 (I suppose that sde is for the specific used usbbus and sde1 is the imation scsistick).
This is my /etc/fstab
/dev/hdb6 / reiserfs acl,user_xattr 1 1
/dev/hdb7 /home reiserfs acl,user_xattr 1 2
/dev/hda1 /windows/C vfat users,gid=users,umask=0002,utf8=true 0 0
/dev/hda2 /windows/D ntfs ro,users,gid=users,umask=0002,nls=utf8 0 0
/dev/hdb1 /windows/E ntfs ro,users,gid=users,umask=0002,nls=utf8 0 0
/dev/hdb5 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
/dev/fd0 /media/floppy auto noauto,user,sync 0 0

As you can see there is no sde-entry in the fstab (= filesystem table). Automatic mount and umount is a specific feature of the distribution, and not standard linux. In standard linux, you have to manualy mount and umount your removable devices. Maybe another member knows the secrets of these features.

Hope this helps,
Thomas

micro_xii 09-07-2006 05:20 AM

im using suse 9, flash disk imation 128mb

linux:~ # cat /proc/partitions ----->without usb disk inserted
major minor #blocks name

8 0 35548320 sda
8 1 1052226 sda1
8 2 34491555 sda2
8 16 71687000 sdb
8 17 1052226 sdb1
8 18 70621740 sdb2
8 32 35548320 sdc
8 33 1052226 sdc1
8 34 34491555 sdc2
linux:~ # cat /proc/partitions ------->usb inserted.
major minor #blocks name

8 0 35548320 sda
8 1 1052226 sda1
8 2 34491555 sda2
8 16 71687000 sdb
8 17 1052226 sdb1
8 18 70621740 sdb2
8 32 35548320 sdc
8 33 1052226 sdc1
8 34 34491555 sdc2
8 80 122879 sdf

using this commands my usb disk works fine
cat /proc/partitions
mkdir /mnt/usb
mount /dev/sdf /mnt/usb
But this commands are temporary,when i unplug the usb and return it...the suse 9 cant detect automatically...i need to type again the commands....i need a command that will mount it permanently and suse 9 can detect it automatically...thx.

/etc/fstab (what additional command should i put here)

/dev/sdb2 / reiserfs acl,user_xattr 1 1
/dev/sda2 /data1 auto noauto,user 0 0
/dev/sdc2 /data2 auto noauto,user 0 0
/dev/sda1 swap swap pri=42 0 0
/dev/sdb1 swap swap pri=42 0 0
/dev/sdc1 swap swap pri=42 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
proc /proc proc defaults 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
sysfs /sys sysfs noauto 0 0
/dev/cdrecorder /media/cdrecorder subfs fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
/dev/cdrom /media/cdrom subfs fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
/dev/fd0 /media/floppy subfs fs=floppyfss,procuid,nodev,nosuid,sync 0 0

liaty 09-07-2006 05:55 AM

before touching your fstab, I would look in system services in yast and check that there is no service for automounting file systems (autofs in 10.1, don't know about 9).

But if you want to add a line to your fstab try from command line as root:

vi /etc/fstab

[esc] i (to get into write mode)

on new line:

/dev/sdf [TAB] /mnt/usb [TAB] auto [TAB] auto,user [TAB] 0 [TAB] 0

then [esc] :wq to save and exit.


create the spaces using the [TAB] button.
There are other options to go with auto,user. Have a google.

Thomas Lemmens 09-07-2006 09:26 AM

In my opinion the reason why you have to mount and umount manually removable devices in standard linux is obvious: the system is loading the fstab entries at boot time. When you are inserting removable devices AFTER boottime, it's unsure how and where the system loads the device. It is depending on other loaded removable devices. You have to fix it manually. A sophisticated distro as suse 10.1 uses autofs to deal with this problem (new autodetected devices). If autofs or equivalent software is absent, (and/or autodetection of new inserted devices is absent,) it makes only sense to change the fstab when you insert the removable device BEFORE boot time (and remove it after shutdown).

Hope this helps,
Thomas


All times are GMT -5. The time now is 09:59 PM.