LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   mounting usb thumbdrive and going in circles (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-usb-thumbdrive-and-going-in-circles-193264/)

slackist 06-14-2004 05:01 AM

mounting usb thumbdrive and going in circles:NOT SOLVED
 
Someone had given me an Apacer 128mB drive with a document I need.

I insert it:

Code:


tail -f /var/log/messages
Jun 14 16:41:52 localhost kernel: hub.c: new USB device 00:1f.4-2, assigned address 5
Jun 14 16:41:55 localhost kernel: Initializing USB Mass Storage driver...
Jun 14 16:41:55 localhost kernel: usb.c: registered new driver usb-storage
Jun 14 16:41:55 localhost kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Jun 14 16:41:55 localhost kernel:  sda: sda1 sda2 sda3 sda4
Jun 14 16:41:55 localhost kernel: USB Mass Storage support registered.



lsmod:
Code:

Module                  Size  Used by    Tainted: P
usb-storage            65536  0
nvidia              1965152  6  (autoclean)
iptable_filter          1644  0  (autoclean) (unused)
ip_tables              12288  1  [iptable_filter]
snd-pcm-oss            37252  0
snd-mixer-oss          11992  1  [snd-pcm-oss]
printer                7040  0
uhci                  24496  0  (unused)
usbcore                58400  1  [usb-storage printer uhci]
.......

When I do mount -t vfat /dev/sda (**or SDA1, 2 etc**) /mnt/thunbdrive

i get
Code:

mount: wrong fs type, bad option, bad superblock on /dev/sda,
      or too many mounted file systems

(/mnt/thumbdrive does exist btw)

When I do mount -t usbfs /dev/sda (**or SDA1, 2 etc**) /mnt/thunbdrive

it shows no error messages, but when I try

ls /mnt/thumbdrive

the output is
Code:

001/ 002/ devices drivers
but not the file I am looking for.


I have a hdd=ide-scsi in my lilo if that is relevant. On a whim i did scanbus -cdrecord:
Code:


scsibus0:
        0,0,0    0) 'LITE-ON ' 'LTR-24102B      ' '5QSB' Removable CD-ROM  <<<<--my hdd
        0,1,0    1) *
        0,2,0    2) *
        0,3,0    3) *
        0,4,0    4) *
        0,5,0    5) *
        0,6,0    6) *
        0,7,0    7) *
scsibus1:
        1,0,0  100) 'USB    ' 'Flash Drive    ' '1.12' Removable Disk        <<<<-- must be the thumbdrive
        1,1,0  101) *
        1,2,0  102) *
        1,3,0  103) *
        1,4,0  104) *
        1,5,0  105) *
        1,6,0  106) *
        1,7,0  107) *

I don't know if the problem is with whatever /dev/*** I am trying to use or something else, any help much appreciated :scratch: :confused:

slackist 06-15-2004 08:17 AM

Wow, 59 reads and no replies, doesn't anybody know.....pleeeeeeze :)

EyesOnly 06-15-2004 08:27 AM

I've noticed that when linux shows multiply paritions on a usb-drive, this mostly means it is a windows formatted drive(formatted like a floppydrive)

check the partitiontable whit fdisk, to see wheter it is correct. If it shows a lot of errors, it is formatted using windows.

slackist 06-15-2004 09:27 AM

Thanks EyesOnly, I did that (fdisk) and you were right. Fdisk complains that the partitions overlap each other etc.

I searched another forum and found this:
Code:

How to solve this problem.

fdisk -l shows 4 partitions (sda1 to sda4), and On Track Disk Manager on sda3.
Trouble comes from this non-standard partition table. So you have to format the drive in a standard way.

1) Save all data stored on the USB flash disk.
2) As root, fdisk /dev/sda1, command d to delete the first partition
3) Repeat for the three other ones.
4) Format the free space in FAT 16; diskdrake from Mandrake is a convenient tool.
5) Delete the /etc/fstab changes.
6) hotplug service must be loaded at boot.
6) You can now plug/unplug your drive.

Now, you have got a generic pendrive, one 256 Mb FAT 16 partition; works fine with Windows, Linux or Mac OS.

I followed that except I used cfdisk to format the free space and it worked fine, and the file that I wanted was still there!!!

Put the following into fstab
Code:

/dev/sda      /mnt/thumbdrive    auto        noauto,users    0  0
and now any user can mount and read/write to the drive :)))))

Thanks,
mark

slackist 06-22-2004 06:15 AM

Oops, spoke too soon; NOT solved :(
 
After doing the things I said the drive worked fine between 2 Linux boxes,
but when I plugged it back into an XP box it complains that the drive is not formatted
and, in typically helpful fashion, offers to format it for me :tisk:

I have reformatted it a few times with cfdisk to W95 VFAT, W95 VFAT (LBA) with the
same result every time I plug it into XP :mad:

So, if anybody has any more suggestions I'd be very happy to hear them,

mark

wpyh 06-22-2004 09:07 AM

I tried this with my Iomega Zip 250 disks: (it's USB, so maybe this can solve your problem too)
1. Empty the disk (of course, copy all the files you want on the disk)
2. dd if=/dev/zero of=/dev/sda bs=1024 count=1024 (with the disk inserted but no partition on the disk is mounted)
3. fdisk /dev/sda (it should complain about invalid partition table but don't worry)
4. create a partition (sda1), make it "W95 FAT32 LBA"
5. write the changes (command 'w')
6. put a filesystem on /dev/sda1 with mkdosfs (i forgot the options but you can check the man page of mkdosfs or mkfs.msdos or mkfs.fat or mkfs.vfat)

Does Windows still say it's unformatted now?

slackist 06-23-2004 07:25 AM

Thanks wpyh,

I borrowed the drive back to try but the owner has already chosen "OK" when XP asks him of he want to format it, and saved some files there.

The files were invisible to me when I mounted it in Linux, so I copied a couple of files to it (no error messages, files showed up fine) and took it back and plugged it into his xp box.

Now the files he put are visible, but mine were not :scratch:

I give up, will buy my own pendrive, and learn some more.

Thanks again,

mark

ps The Swiss army knife USB drives example: www.iwoot.com/SWI64M.htm look pretty cool :D

Electro 06-23-2004 05:07 PM

For removable storage devices, you have to include sync in the mount options because if you do not you will have data corruption or the data will not be written the drive yet. Putting a line for removable storage devices in fstab will not work well if you have a bunch of usb thumb drives, a USB hard drive, and a USB CD-ROM. I suggest mounting USB drives manually.

For FAT partitions, inlcude umask=000 so that you have write permission for directories and files.

Each USB thumbdrive, USB CD-ROM, USB DVD-ROM, etc has its own way of handling USB data. It may work in Windows but not in LINUX.

Just make a partition with ID number 83. Then format it as a FAT filesystem. It will then work in any OS that can read FAT. I did that for my thumb drive and my 120 GB hard drive. They work.

Ryan_moure 07-23-2004 02:28 AM

I had similar problems with mine
 
I recomend trying to format it again using windows, but make sure you don't take the default of fat32 choose fat.
mount it as
mount /dev/sd*1 /mnt/thumdrive
sd*1 being scsi device that your thumbdrive is considered mine is sda1.
Yeah sounds alot like what happened with me till I mounted it as a scsi device with a file system I could write.

ryan_moure

efanning 07-27-2004 01:01 AM

I've got a SanDisk 128Mb thumbdrive. The only thing that I do is su to root, I have a directory off of root called USB, after I insert the thumbdrive I type.

Code:

mount /dev/sda1 /usb
Once this is done, it mounts it and I can see my entire drive. There was no formatting needed in either Linux or Windows. I've done it this way with Mandrake, SUSE, RH9, and my latest of FC2.

Hope this helps.

Eric

MS3FGX 07-27-2004 01:36 AM

Your situation does seem odd.

I have used my 128 MB USB drive on Windows 2000, XP, and every distro of Linux I have ever worked with, without ever making any changes to the drive. It worked fine will all the OSes right out of the box.

Ryan_moure 07-27-2004 08:30 PM

more that I reformatted it
 
I think it's more that I reformatted it on windows xp using fat 32 instead of fat.
That's why I had the problem not anything else.

ryan_moure

::If you try reading the manual but there is none.
Please feel free to write one. That way one of us actually knows what we're doing.::


All times are GMT -5. The time now is 02:18 PM.