![]() |
USB drive... /dev/sda1 doesn't show unless I try mounting /dev/sda as vfat
I'm using a Kingmax USB 2.0 thumbdrive. Kernel 2.6.10, Slackware Current.
When I plug it in, /dev/sda appears in my filesystem, but /dev/sda1 doesn't show. It seems that the driver isn't able to get access to the partition table on its first try. Here's the dmesg output: Code:
hub 3-0:1.0: state 5 ports 6 chg ffc0 evt 0002Code:
mount /dev/sda /mnt/usb -t vfatCode:
sda: assuming Write EnabledCode:
mount /dev/sda1 /mnt/usb -t vfatAny ideas? |
Welcome to LQ!
Ideas, yes. I had the same type of issue with a USB 2.0 flash drive, but it wasn't exactly like yours. I put those guys in /etc/fstab and always had the correct command, but a lot of times it wouldn't find it just as your output in the first example. The problem with mine was the formatting of the flash disk. I reformatted it FAT32 from within Slackware, and it always works now. Try these two things. First, put it in /etc/fstab as such: Code:
/dev/sda1 /mnt/usb vfat noauto,users,rw,umask=1000 0 0Second, reformat it from command line with this command: Code:
/sbin/mkdosfs -F32 -v /dev/sda1The other thing you might need to do is run "cfdisk /dev/sda" and erase the old partition table and write a new one. If so, the type for the FAT32 filesystem is 0C. |
Thanks for the ideas. I gave that all a try, even repartitioned and reformatted the drive, but it still doesn't show up as /dev/sda1 by itself. Although I've found now that after I've run fdisk -l (which shows the partitions just fine), /dev/sda1 magically appears. I guess the USB drive just needs more time to initialise after receiving power than the drivers allow it.
Well, as a temporary solution I just made this alias: Code:
alias usb='mount /dev/sda 2> /dev/null; mount -v /mnt/usb'It's a strange hack, but afaik mount is the only user level command that makes it reread the partition table. In any case, it works just fine for now. Just would be nice if it wasn't necessary. |
If I'm following you, are you just not waiting long enough for it to scan?
Could you unplug it, then plug it in and wait a while, then post the "dmesg | tail" output? |
Same issue with compact flash card
I have the same issue with a flash card reader. Even when a card is inserted I had to 1- mount /sda and get an error in order to have sda1 appear... My solution was to add the following in the rc.local:
mknod /dev/sda1 b 8 1 and this in my fstab: /dev/sda1 /mnt/reader vfat noauto,users,rw 0 0 It seem that hotplug is not creating the entry in /dev . Maybe because when a card is inserted the system is "passive" it does not detect that you have insert a card in the reader, therefore the reason why you have to mount 1 time so the system say: OH! there is a card now in the reader... let's create /dev/sda1 and then able to acces the card. My solution bypass this issue, I can now mount without having an error since I create /dev/sda1 when the system is started. I still have issue however with the fact that I need to mount and unmount flash card a lot on my system (about 10-15 time an hour) and this has for effect that /sda DISSAPEAR and the device is no more accessible. Maybe some could help on this issue? See post: http://www.linuxquestions.org/questi...d.php?t=272359 Hope this help somehow. Claude |
Quote:
Quote:
|
Just run 'hdparm -z /dev/sda' to tell the kernel to rescan the partition table. I suggest setting up sudo to run this command to run it as a normal user.
Adding a line in /etc/fstab for USB storage devices is not smart because USB storage devices changes their device nodes over time if usb-storage and sd_mod is not removed. Though if you still want to place a line in /etc/fstab for USB storage devices, include only the label of the device that was set during formating the partition. |
Simplest advice always the best
Quote:
When I changed kernels, I never thought to update the entries in the old fstab file that I needed when the HALD was not on board. Grrrrrrrrrr :D Cheers for the (obvious but) very useful tip! :Pengy: |
I want to write a software that will be able to access USB drive. Can anyone help me please?
|
| All times are GMT -5. The time now is 02:21 PM. |