PDA

View Full Version : Success -> USB Memory Key to Store Knoppix Configuration



jBeach
06-20-2003, 10:03 PM
I'm using a 32 megabyte USB memory key to store Knoppix'e configuration and home directory data. It works fine, but I have a few questions.

I had a hard time figuring out the device name for the USB key. I looked in /var/log/messages and it was always empty. I looked inthe daily message and found the following:

# dmesg | grep sda
Attached scsi disk sda at scsi1, channel 0, id 0, lun 0
SCSI device sda: 64000 512-byte hdwr sectors (33 MB)
sda: sda1 sda2 sda4
#

So i made a mount point mkdir /mnt/usbkey and then mounted sda with mount -t vfat /dev/sda /mnt/usbkey. That worked OK, I could save files to the new mount, but I couldn't select /mnt/usbkey in KNoppix's save configuration dialog.

I could select floppy, /mnt/sda1, /mnt/sda2, or /mnt/sda4 in the save configuration dialog. Apparently these got automounted somehow. Selecting /mnt/sda1 resulted in a save configuration error. Selecting /mnt/sda4 worked perfectly. It also worked fine for creating a home directory image. The config and home directory also restore correctly on boot up too. :D :D

Where did /mnt/sda1, /mnt/sda2, and /mnt/sda4 come from? Knoppix must have automounted them? Why did /mnt/sda1 not work, but /mnt/sda4 work?

What was the sda: sda1 sda2 sda4 part of the daily message telling me?

I guess the plan is to just pop a USB memory key in, let Knoppix automount it, and go from there...


-jb

jBeach
06-21-2003, 06:11 AM
I brought the USB Memory Key home and tried it on my Dell notebook. It didn't see Knoppix's configuration or home directory files. It gave the same error I was getting with a floppy drive (/dev/ Is a directory - Mount failed, retry? [Y,n]. Efforts to save the configuration failed.

Plugging the card in after the computer booted created the same three new mount points I got on my IBM Thinkpad at work. Knoppix's save configuration again listed /mnt/sda1, sda2, and sda4 mount points, but only /mnt/sda4 would successfully save the configuration. Viewing sda4 in Konqueror showed Knoppix's configuration files and also the other files I had copied at work on my work computer.

After saving the configuration on my home computer, booting with the knoppix lang=us myconfig=scan home=scan parameters worked correctly.

Conclusions:

Wait until Knoppix boots before putting the USB Memory key in for the first time.

A Knoppix configuration saved on one computer will not necessarily boot and work on another computer.

Although Knoppix's save configuration program lists /mnt/sda1, sda2, and sda4 for options, only /mnt/sda4 will work successfully.


-jb

garyng
06-21-2003, 07:58 AM
you may try :

fdisk /dev/sda to check what is really on the disk. It could simply be that the 'disk' is format and partition in such a way that sda1 and sda2 are just those FAT extended partition stuff which contains no real fs and only sda4 has it.

This is similar on a harddisk with more than one FAT partitions. On my machine(HD), it says :

hda1, hda2, hda5

and hda2 is not usable as it is just a 'container' for hda5 and the rest, if there is any. As for why your sda1 is not usable, it could be because the USB key drive is bootable and hda1 stores some information there and it is not really a FAT.

curious to know what you see with 'fdisk /dev/sda'

jBeach
06-22-2003, 11:55 PM
curious to know what you see with 'fdisk /dev/sda'

Here's what it looks like. Interesting that the other partitions actually exist on the USB memory card. I'm beginning to think they are involved in a password scheme the Buslink memory key has.

root@ttyp1[knoppix]# fdisk -l /dev/sda

Disk /dev/sda: 32 MB, 32768000 bytes
2 heads, 32 sectors/track, 1000 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/sda1 ? 29215178 31850952 84344761 69 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(68, 13, 10) logical=(29215177, 1, 6)
Partition 1 has different physical/logical endings:
phys=(288, 115, 43) logical=(31850951, 0, 23)
Partition 1 does not end on cylinder boundary.
/dev/sda2 ? 26586242 55803140 934940732+ 73 Unknown
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(371, 114, 37) logical=(26586241, 1, 26)
Partition 2 has different physical/logical endings:
phys=(366, 32, 33) logical=(55803139, 1, 18)
Partition 2 does not end on cylinder boundary.
/dev/sda3 ? 41 41 0 74 Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(371, 114, 37) logical=(40, 0, 14)
Partition 3 has different physical/logical endings:
phys=(372, 97, 50) logical=(40, 0, 13)
Partition 3 does not end on cylinder boundary.
/dev/sda4 1 53673648 1717556736 0 Empty
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 0) logical=(0, 0, 1)
Partition 4 has different physical/logical endings:
phys=(0, 0, 0) logical=(53673647, 1, 32)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order
root@ttyp1[knoppix]#


-jb

jBeach
06-23-2003, 10:35 PM
For some reason, Knoppix stopped detecting the memory key I was using. Sometimes it would detect it, sometimes it would not.

Since I already had "issues" with the multiple partitions, I thought I'd get Crucial USB compact flash holder and start over with a new card. I use compactflash cards for my camera, so I have several small cards laying around.

Knoppix is unable to detect my USB compactflash card at all. It does not appear in /proc/scsi/scsi or dmesg or /proc/partitions. When I plug it in, the LED illuminates and the hard disk spins up for a second, but the device never shows up... Of course both cards work fine in Windows 2000...

Is there a forced hardware scan that I can run to discover the USB memory?

-jb

garyng
06-24-2003, 01:18 AM
most likely than not, it cannot see your reader(or should I say it doesn't like your reader). If that is the case, either you have to recompile a new kernel(well a new module but since linux kernel and modules are so tightly coupled, it is better to compile everything) or you may wait for a newer KNOPPIX which may contain 2.4.21 that has more USB storage device support.

jBeach
06-25-2003, 06:28 AM
most likely than not, it cannot see your reader(or should I say it doesn't like your reader). If that is the case, either you have to recompile a new kernel(well a new module but since linux kernel and modules are so tightly coupled, it is better to compile everything) or you may wait for a newer KNOPPIX which may contain 2.4.21 that has more USB storage device support.
I think you are right. USB is very finnicky... My BusLink USB memory key works all the time on my ThinkPad at work and about 50% of the time on my Dell Inspiron notebook at home. When I get the directory error on my Dell, I just power off, then power on, then type the myconfig and home parameters. It usually sees the USB memory key after the second or third time.

The Crucial USB compactflash reader failed on both computers 100% of the time. I tried it with three different compactflash cards and they all failed.

I read in the Cheatcodes files that Knoppix would read the knoppix.sh file from the root of the CD at boot time. I removed some white papers to make room for the knoppix.sh file and the configs.tbz file. Unfortunately Knoppix started in a Knoppix Lite mode with the message Can't find Knoppix filesystem, sorry. Dropping you to a (very limited) shell. Maybe those pdf files have to stay there...

Any idea when Knoppix with the new kernel will be out?

-jb

wally_lawless
12-02-2003, 06:04 PM
Good afternoon all, I've been travelling these forums a lot trying to solve my problem of my USB key not being accessible for saving config or for setting persistent home directories. Wasn't able to find much in the way of answers, so I started messing around on my own.

I used fdisk /dev/sda in Knoppix shell and found that there were indeed four partitions on my measly 32mb Sony Microvault. For some reason none of the partitions were accessible though without a significant amount of tweaking. I went ahead and deleted all 4 of the partitions on my key and verified that they were indeed gone.

Next I simply plugged the key into my Windows XP box (gotta keep one around for Visual Studio work) and formatted the drive as FAT16 (for some reason when Sony ships them they are formatted FAT12, which is quite useless)

I then went back to my Knoppix machine and plugged in the key and the icon automatically appeared on my desktop as a mount to /dev/sda1. I am now able to save my config as well as create a persistent home dir on the key. I have since tried this same technique on a number of different keys I was having problems with, every one works like a charm.

Hope that helps.

Wally Lawless
http://www.power-coder.com

lunat1k
12-26-2003, 09:41 AM
I had the same problem with /dev/sda1-4 being recognized, but only /dev/sda being actually usable when there was only one partition. This FAT12 vs FAT16 thing may be the root cause.

I worked around it by making 2 partitions on the key using the vendor supplied tool, but the FAT16 reformat sounds better.

koma
01-03-2004, 07:33 AM
hi all..

i've been having trouble trying to mount my sony memory card as well.. following through some of the above suggestions i have found that my card too is coming up as FAT12..

Disk /dev/sda: 16 MB, 16220160 bytes
4 heads, 16 sectors/track, 495 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 494 15795+ 1 FAT12

is there anyway to format the card to FAT16 using knoppix?.. i find i can mount the device but can't see anything on it.. any other suggestion?

Cheers in advance..

AerosSaga
01-07-2004, 06:25 PM
I was having the same problem with my Sony Microvault 256. It appeared fine under Windows, but under Knoppix it had the four sd devices as everyone else has mentioned. I could only mount/write to sda4 which would not work for me since I am booting flonix from this drive and thus had to be sda1. Firstly, Backup any info that you will need that is on the drive!! It will be erased!! You are forwarned. What I did was:

1) fdisk the drive in Knoppix. Put in all sorts of wacky numbers in the partition table. This will corrupt it forcing a clean fat16 format in windows.

2) Boot into windowsXP, 2000 may have this feature as well, not sure. After your in XP you can explore your drives and you will see that it sees your thumbdrive, but cannot read it. Great!, this is what we wanted!

3) Go to Administrative Tools->Computer Management->Disk Management. Locate your flashdrive rightclick format or make partition, can't remember which and oila!. Now your drive will be mountable as sda1 and only show the one partition. I hope this helps I beat my head against the wall for about four hours tryn to solve this one.

Regards,

Aeros

esor_ekim
01-13-2004, 01:01 PM
I thought I should post a reply as the info in this thread has been very useful. One of my users has had the same problem with a noname 256MB key flash thingumy. Can only mount as /dev/sda and there are 4 sillyl partitions on the usb device.

He tried formatting the thing on this Windows computer at home (FAT 16) and that seemed to do nothing - one assumes Windoze lied about reformatting the device.

I then did:

fdisk /dev/sda
deleted all 4 partitions
created one primary partition
changed the type of the primary partition to FAT 16
exit fdisk and save
mkfs.vfat /dev/sda1 (this is VERY quick, and I did actually wonder if it had worked)
mount -t vfat /dev/sda1 /usb
touch /usb/test
echo "HURRAH IT WORKED" > /usb/readme
ls -l /usb works rather well.

Then put this into /etc/fstab
/dev/sda1 /usb auto noauto,owner,user 0 0
for the happy user

I stuck the usb flash key into a Windoze 2000 computer and it worked fine and dandy.

If this is the manufacturers of flash devices using FA12 then they are total numpties and I have to wonder why Windoze computers can actually work with these devices when they have such odd partition tables and file systems.

lunat1k
01-14-2004, 01:30 AM
I believe that Linux simply doesn't deal with FAT12 correctly, this would explain why FAT12 memory devices are not a problem on Windows, but are a problem on Linux (Show up as having 4 partitions). The reasons FAT12 is commonly used on flash devices are:
A) Microsoft is enforcing patents involving FAT16/32 and Long File Names
B) Most devices don't need the extra storage FAT16 provides

From one of the prior posts, it sounds like the windows format utilities don't always work to reformat the devices as FAT16, that's best done using the flash vendor utility or Linux utilities like fdisk and mkfs.

I filed a Knoppix bug about this, but I believe it's more of a kernel issue.

outanet
02-29-2004, 11:56 AM
I have been trying this for a week now, (cyberkey and a gigabyte mb) with no hope, ive installed both flonix (which seems to have lost documentation) and Runt. It wont go any further than the boot floppy, however i can mount the key on sda1 in my HDKnoppix. I guess its a case of some you win some you wont, Im gonna try on other equipment. :?