PDA

View Full Version : USB storage devices



srowe
05-22-2003, 05:20 PM
Does anybody else have problems accessing USB flash disks etc? The problem is that some devices have bogus partition tables and so you end up with

/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4

instead of a single

/dev/sda

If I blank the device with dd and create a FS with mkdosfs then it works fine (except for a desktop icon, a bug in mkdesktophdicons).

I've a patch to scanpartitions that makes it work the way I think it should.

rickenbacherus
05-22-2003, 05:32 PM
What makes you say the partition table is bogus? Is it not actually there?

I have no trouble accessing USB disks no matter how many partitions they have. I don't use desktop icons myself so I'm not much help there.

Stephen
05-22-2003, 05:33 PM
I've a patch to scanpartitions that makes it work the way I think it should.

You should submit it to bugzilla (http://www.knoppix.net/bugs/) to see if can be included.

srowe
05-23-2003, 08:41 AM
What makes you say the partition table is bogus? Is it not actually there?

I have no trouble accessing USB disks no matter how many partitions they have. I don't use desktop icons myself so I'm not much help there.

There are no partitions, just a single FAT FS. The kernel however reports 4 partitions

May 16 09:25:07 macau kernel: SCSI device sda: 128000 512-byte hdwr sectors (66 MB)
May 16 09:25:07 macau kernel: sda: Write Protect is off
May 16 09:25:07 macau kernel: sda: sda1 sda2 sda3 sda4

/proc/partitions shows

major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

8 0 64000 sda 122895 45 245880 874940 1025 121855 245760 2596960 0 973410 3471900
8 1 2023554176 sda1 0 0 0 0 0 0 0 0 0 0 0
8 2 1408628884 sda2 0 0 0 0 0 0 0 0 0 0 0
8 3 5 sda3 0 0 0 0 0 0 0 0 0 0 0
8 4 490806906 sda4 0 0 0 0 0 0 0 0 0 0 0

Look at the block counts, I call those bogus.

It isn't just a single device, I have three completely different ones that exhibit the same behaviour.

I guess it's really a kernel issue, it shouldn't consider those partitions as valid.

srowe
05-23-2003, 10:14 AM
It looks like the issue is related to SYSLINUX, the devices have a bootable image dd'ed on to them.

It seems that SYSLINUX uses the end of the root sector for code/string storage and this confuses the kernel into enumerating the bogus partitions.

Francesca
10-27-2003, 02:30 PM
I tried with knoppix 3.3 and the USB device is not recognized at start-up.

Using knoppix 3.2 the USB device is recognized but I have the problem with the four sda partition none of them mountable.

The usb device is not recognized with 'fdisk -l' but compares together with CD-ROM using 'cdrecord -scanbus'

Please, is there a command or a sequence of command to make the usb device work? I have only a work PC with a signle NTFS partition, so, no other way to use linux apart the live cd-rom version and the usb fat32 drive.

paradocs
10-28-2003, 07:41 AM
Hi Francesca,

I like running KNOPPIX from the CD.
I tried the USB sticks but had some problems and
gave up using them for now.
I don't know why knoppix3.3 would be so differnt
but I find that it does give a differnt number to my
second usb CDRW device. I backup and restore files
to and from a second CDRW.

Have you tried cfdisk and a linux partition on your usb drive?
But then you can not read it from windows. :cry:

Best Wishes
paradocs

c_cinq
10-29-2003, 11:08 PM
paradocs

Posted: Tue Oct 28, 2003 1:41 am
Hi Francesca,

I like running KNOPPIX from the CD.
I tried the USB sticks but had some problems and
gave up using them for now.
I don't know why knoppix3.3 would be so differnt
but I find that it does give a differnt number to my
second usb CDRW device. I backup and restore files
to and from a second CDRW.


how do you mount your usb cdrw? Does K3b recognizes it automatically?

paradocs
10-30-2003, 07:54 AM
Hi c_cinq,

KNOPPIX is very good (sorry not perfect) at hardware
detection. A usb CDRW should work just fine when booting
from the KNOPPIX CD. It will be automatically mounted
as /dev/cdrom1 /mnt/cdrom1 if KNOPPIX is on /cdrom.

I find a second CDRW (perhaps a DVDRW is in my future :wink: )
to be an excellent addition to a KNOPPIX system.

Yes K3b will work just fine -- although you can easily learn
the shell commands for cdrecord to blank and write to it
directly.

Two cautionary notes are in order:
1) packet writing is not yet here for KNOPPIX -- now you can only
blank a whole CDRW and the burn to the whole CDRW.
2) With a hard drive install it will take a little more work to get
the usb drive mounted. One way of course is to get the usb
CD working from the CD boot and then reinstall. To make
a hard drive install work without reinstalling you have to things
to /etc/fstab and I am not the one to ask about that.

My project for automatically saving and restoring /home/knoppix
to a CDRW is very preliminary -- but here is a link for what it's
worth.
http://www.knoppix.net/docs/index.php/BurnHome

Best Wishes,
paradocs

Johnny3
11-03-2003, 04:55 PM
I'm having a similar problem with "writing" data to any USB device with Knoppix.

I'm being challenged on trying to move data from a HD to a USB drive pen. All the devices are recognized, but everything stops there...

The main error I keep getting is "Directory can not be created".

Can one of you "Guru's" take a moment a post some simple step-by-steps from booting with the Knoppix CD to configuring a USB device to copy and paste files?

Thanks! :oops:

paradocs
11-04-2003, 05:18 AM
Hi Johnny3,

KNOPPIX by default makes devices read only. It
is part of the philosopy of a demonstation project
to not harm a system, unless the user enables
something.

I suspect you need to right click on the desktop
icon --> propertiex -->device --> and uncheck
the read only box.

Some usb pen drives may need to be partitioned
and formated -- but most should work as they are.

Best Wishes
paradocs

c_cinq
11-05-2003, 01:06 PM
how to mount the usb devices or create icons on the destop which points to the proper device? do I find such mounting point in fstab or proc or dev or usbview?

paradocs
11-06-2003, 05:22 AM
Greetings c_cinq,

My experience is with KNOPPIX CD -- not with KNOPPIX converted
to a dabien hard drive install.

The CD does a good job a setting up the file
/etc/fstab.

You may rebuild it by entring the folling command in a shell:
rebuildfstab -r

You may update the icons of the hard drives on the KDE desktop with:
mkdesktophdicons

For othes right click and the desktop, create new ...
A frequent problem it to fail to make the device rw.
Right click the icon, properties, device, unclick read only.

Best Wishes
paradocs

jpmierau
12-17-2003, 07:29 PM
Hi folks, any help greatly appreciated!

In my konqueror view, sda1 (lexar jumpdrive) shows up, as does my card reader as sdb (oddly enough, just sdb even with three cards in it).

In fstab (after a rebuildfstab -r) I see entries for sda1, sdb1, sdc1 and sdb with the following syntax:
/dev/xxx /mnt/xxx auto noauto,users,exec 0 0

Here's the prob:
I can't write to sda1, the jumpdrive, though I can read from it (this is AFTER changing permissions to read, write, execute, & granting those permissions to all users through konqieror>>properties).

Much help would be appreciated, been pounding keys for 3 hours to absolutely no avail -- thanks in advance!

+++++++
Knoppix...it's a good thing!
+++++++

lunat1k
12-26-2003, 09:30 AM
I've had the same problem with the /sda1-4 being recognized.

With my unpartitioned usb drive, the actual usable device is just /dev/sda without a partition#.

I had to either:
A: Manually mount like: mount -t vfat /dev/sda /mnt/mountpointyoucreated
or
B: Use the vendor supplied windows utility to partition the usb key into 2 or more partitions.

The latter saves on confusion if you do find yourself running into this.

Why is it like this? I'll leave that to the kernel guys...

cputoaster
01-11-2004, 07:36 AM
I can't get my USB flash disk (or any other USB device except the hub) to work. This is what I did for my laptop wich uses UHCI:

I added in /etc/fstab this line:
"none /proc/bus/usb usbdevfs noauto 0 0"
and next i run in a root shell "mount /proc/bus/usb"

I run usbview, which comes with Knoppix,and get this output:
USB UHCI Root Hub
Serial number: 2400
speed: 12Mb/s (full)
Number of ports:2
Bandwidth allocated 0.900 (0%)
Total number of interrupt requests: 0
total number of isosynchronous requests: 0
USB Version 1.00
Device Class: 09(hub)
Device subclass 00
Device protocol:0
Max Default Endpoint size: 8
Number of configurations:1
Config number:1
Number of interfaces:1
Attributes:40
MAx power needed 0mA

Interface Number 0
Name hub
Alternate number:0
class 09 (hub)
sub class :0
Protocol: 0
Number of endpoints:1

Endpoint address: 81
direction: in
attribute:3
type" int.
max packet size:8
interval 255ms


After running "lsmod |grep usb" I obtain:
usb-storage 60960 0 (unused)
usb-uhci 21836 0 (unused)
usbcore 57472 1 [usb-storage usb-uhci]

If I try to mount the Sony USB flash disk with this command: "mount -t vfat /dev/sda1 /mnt/flashdisk", I
get "/dev/sda1 not a valid block device". Usiing /dev/sda /dev/sda2 does not
make any change. I created the mount directory myself.
Why don't I get any proof of the Sony USB 2.0 flashdisk in terms of some current more than 0mA or any mention of the flashdisk itself? I plug in a USB mouse and get no difference. Am I supposed to see a 001 and a 002 directory in /proc/bus/usb to say one hub device plus one flashdisk?

I read at http://www.linux-usb.org/USB-guide/c122.html that I must make menuconfig to add devices to be registered in the /proc/bus/usbdrivers? What directory am I supposed to be in for that make? Is this the only way to do this?
Any help greatly appreciated,
Thanks

cyclotron
11-12-2004, 04:07 AM
Dear all,

I ran into these problems when I tried to connect my digital camera to my computer after using a USB memory stick. The stick was on /dev/sda4 and the camera on /dev/sda1. When I tried to mount the camera I got a pop-up saying "/dev/sda1 is not a valid block device".
I do not know how to realy solve the problem in a nice way, but a manner of living with the problem is to remove the usb-storage module and then initialize it again. To do this, use
<unmount and plug out the device you used.>
modprobe -r usb-storage
modprobe usb-storage
<plug in and mount the device you want to use.>
in a terminal. Most likely you have to login as root to do so.
I'd love to hear better solutions.

cyclotron

Mickey_p
11-13-2004, 02:05 AM
I have an M-systems DiskOnkey USB disk

I run Knopppix 3.4
under vmware workstation 3.2 build 2230 over a Microsoft Windows 2000 Professional sp3

I had to go to Devices in vmware to allow sending my usb to the linux box.

-----------------------
i too get 4 partitons for my small 32mb usb device, but hey thats life..

when i mount /dev/sda1 it has a file devices there that tells me the exact company, so i know it's recognized.

at first i edited the /etc/fstab manually (im new to linux, jus installed yesterday..)
and it worked, mounting to /dev/bus/usb
-thanks goolgle, and linux-org, linux-usb and others..

----------------
now i restarted and simply typed in

mount /dev/sda4 /dev/sda4
when i clicked the sda4 icon in the dsktop, it was already mounted, and a quick check with
mount informed me it was already rw for owner..

owner being root i assume

btw, i have been mounting through smbfs which is much more convenient..

the cmdline is

mkdir /mnt/sharename
mount -t smbfs -o username=user,password=pass //windowsmachine/share /mnt/sharename
ln -s /mnt/sharename ~/sharename

this is very easy to acheive, and since i am having trouble with setting up the home dir and config file to a stadard port, i keep having to type in these commands with every boot. luckily the vmware allows me to suspend the machine instead of closing it.



i use x-win 5.2 and putty with X11 forwarding
but i cant setup the knoppix box to NOT LOAD X-Windows on startup, does anyone know how i can do this ?

i want to load X by myself, from a terminal.

thanks.

-Mick