Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have been trying for a while now to get my pen drive working. I have searched around the net on the subject but have gotten nowhere. I restarted before doing any of the following.
When I run 'lsusb' it shows the following:
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 002: ID 0ea0:2168 Ours Technology, Inc.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
And when I enter 'dmesg | grep -i "SCSI device" ' I get
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
using 'cfdisk /dev/sda' gives me:
ERROR: Bad primary partition 0: Partition begins after end-of-disk
Press any key to exit cfdisk
or
FATAL ERROR: Cannot open disk drive
Press any key to exit cfdisk
I used 'mount /dev/sda /mnt/sda' because it said sda in the previous part and it mounted fine (always seems to work on first try after restart). I then used 'umount /mnt/sda' to unmount. I mounted and unmounted in the same fashion without unplugging the usb drive. During this time the small light on my usb drive was blinking green. I than unplugged it and tried the same thing again. This time the light stayed solid and when I tried to mount it gave me the following message:
'mount: /dev/sda is not a valid block device'
When I used 'dmesg | grep -i "SCSI device" ' again after unplugging and reinserting I received 2 lines instead of one like before:
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
so it seems like as soon as I unplug it, plug it back in and try again it gives me the preceeding message but if I dont unplug it it seems to keep working. I also tried sda1 instead and it also gave me the same mount error. Also sometimes the light on the usb drive does not come on at all but still shows up if I use 'lusb'.
I am not really familier with linux to know how to use many commands but I thought if I shared this information someone may be able to help. Any help is appreciated.
Sounds like your system (you didn't say what distro you were using) is mounting it when you plug it in. Then when you try to cfdisk it can't because it's a mounted drive.
Looks like it detected the drive. Did you check /mnt first to see if there were any additional mount points added. Try running:
cat /proc/partitions
then
ls /mnt
before and then after you plug your drive in and see if there is an listed sda there...
KC
What you may have done is add another mount point /sda when there may have been one already like /Thumb_Drive or something.
Thanks for your replies, I am using Damn Small Linux. Here are my results:
cat /proc/partitions (without usb drive plugged in):
major minor #blocks name
8 0 256000 sda
8 1 84344761 sda1
8 2 934940732 sda2
8 4 1717556736 sda4
3 0 2062368 hda
3 1 249952 hda1
3 2 1812384 hda2
ls /mnt (without usb plugged in):
auto floppy hda sda sda2 sdb1
cdrom hd hda2 sda1 sda4
cat /proc/partitions (with usb drive plugged in):
major minor #blocks name
8 0 256000 sda
8 1 84344761 sda1
8 2 934940732 sda2
8 4 1717556736 sda4
3 0 2062368 hda
3 1 249952 hda1
3 2 1812384 hda2
ls /mnt (with usb plugged in):
auto floppy hda sda sda2 sdb1
cdrom hd hda2 sda1 sda4
so it shows the same whether the drive is plugged in or not, even though 'lsusb' see's it. I am not sure what this means. All of the folders set up under /mnt were done by the system so I am not sure why there are so many. I also noticed that under /mnt/auto there is 'floppy' & 'cdrom'. I appreciate the help because all of this is still confusing to me.
What distro are you running? I run Fedora, all USB configs happen automatically & works perfectly.
I am unfamiliar with the term "pen drive". What kind of USB device is it? Flash card reader, memory stick, external hdd, etc.
You posted that "cat /proc/partitions" shows sda1,2,4 as existing. Do you have any scsi or sata devices installed? If not, what are these entries referring to? /dev/sda, sdb, etc. is first & foremost used for scsi devices. Linux usually uses the next /dev/sd? that is available for USB drives, sata drives & other non IDE data storage devices.
If you don't have any scsi devices, or you know that you have no other use for the sda mount-point dirs in /mnt, delete them all & reboot. Then plug-in your USB device & check /mnt for any new entries.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.