LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   SD card & USB stick format chaos (https://www.linuxquestions.org/questions/slackware-14/sd-card-and-usb-stick-format-chaos-489324/)

JohnKFT 10-04-2006 06:50 AM

SD card & USB stick format chaos
 
Slack 10.1, kernel 2.6. Usually inserting my SD cards into PCMCIA slot or card reader generates a device /dev/hde1 or /dev/sda1. Inserting a second one produces hdg1 and sdb1. Some cards/usb sticks however, generate just the hde, hdg, sda, sdb without the 1, causing chaos to my carefully set up fstab. If I format a card or stick using mkdosfs /dev/whatever (because something has corrupted) the thing always then produces the device with no number,even if it used to produce a numbered device. It also seems to say "unknown partition table" in dmesg.

I feel in a complete muddle and do not know what to do next. My family cannot cope with trying to figure which device their card is going to show up in. Can anyone guide me please?

sfaz32 10-04-2006 07:16 AM

Hi JohKFT,

You need to umount the device and create a partition on the drive.
"/dev/sda1" refers to the device sda on partition 1.

As root,
Code:

fdisk /dev/sda
at the command prompt, do

"n" to create a new partition
"p" for primary
"1" for partition 1
Now set the size correctly.

Next you need to change the type to FAT16 (assuming you want to use mkdosfs)
at the command prompt, do

"t" to change the type
"1" for partition 1
"6" for FAT16

after that you need to save the changes with "w"

then proceed to
Code:

mkdosfs /dev/sda1

dennisk 10-04-2006 07:32 AM

Managing multiple USB devices is not something that Slackware does yet. I believe HAL (Hardware Abstraction Layer) is designed to handle this but Hal isn't compiled into Slackware.

Dennisk

JohnKFT 10-04-2006 05:56 PM

Hey sfaz - brilliant, thank you. Not only have I fixed the problem but I understand it. No more "Why isn't my card mounting?" Don't quite know how the problem arose. When I printed the partition table from one of the cards I got this:

Disk /dev/sda: 2059 MB, 2059403264 bytes
64 heads, 62 sectors/track, 1013 cylinders
Units = cylinders of 3968 * 512 = 2031616 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

Device Boot Start End Blocks Id System
/dev/sda1 ? 196103 483782 570754815+ 72 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(357, 116, 40) logical=(196102, 51, 11)
Partition 1 has different physical/logical endings:
phys=(357, 32, 45) logical=(483781, 40, 51)
Partition 1 does not end on cylinder boundary.
/dev/sda2 ? 42513 530423 968014120 65 Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(288, 115, 43) logical=(42512, 30, 47)
Partition 2 has different physical/logical endings:
phys=(367, 114, 50) logical=(530422, 52, 42)
Partition 2 does not end on cylinder boundary.
/dev/sda3 ? 471241 959151 968014096 79 Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(366, 32, 33) logical=(471240, 18, 30)
Partition 3 has different physical/logical endings:
phys=(357, 32, 43) logical=(959150, 39, 39)
Partition 3 does not end on cylinder boundary.
/dev/sda4 ? 1 916640 1818613248 d Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(372, 97, 50) logical=(0, 0, 1)
Partition 4 has different physical/logical endings:
phys=(0, 10, 0) logical=(916639, 47, 30)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

Yikes!! I did o to get a new partition table then followed your instructions. Card now has nice neat single partition and registers on /dev/sda1.

dennisk - I seem to be able to mount multiple devices no problem - just had to run dmesg to find out where they are, then set them in my fstab.

2GB cards still won't register in my Palm pda although apparently changing them from FAT32 to FAT16 should make them do so according to the Palm forums. Any idea off your head if this might be related to the original problem in any way, or should I open a new thread?

dracolich 10-04-2006 05:59 PM

If you have udev running I'd recommend making some udev rules to manage them. That's what I did for mine to create automatic symlinks for each.

Denes 10-04-2006 06:31 PM

I have had issues mounting SD devices in Linux as well. I am running CentOS4.3 but I assume that these issues are in all Linux distro's that use similar versions of software. My problems all seem to go away magically when the HAL daemon is running. If I just turned on my Linux box for example and have the locking tab on the SD card, the SD card will not mount. Once I turn the HAL daemon on this magically is fixed or if I insert media that is not write protected I am okay from that point on. I wonder since your distro doesn't have a HAL daemon if you see this as well. Hmmm.


All times are GMT -5. The time now is 03:36 AM.