SlackwareThis Forum is for the discussion of Slackware Linux.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Note: I used google already. I searched the web already. I searched these forums. I only post here when all the usual solutions don't work.
I know how to write udev rules. I have an external hard drive, a zip drive, a cheap camera that mounts as if it were a small hard drive. And they all mount nicely with custom dev names, etc.
The actual problem
I recently got a thumb drive aka key drive (aka little bitty thing you stick onto your computer and it's got memory and you can use it as a harddrive).
$ mount /mnt/4gig
mount: block device /dev/sr1 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sr1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
$
Code:
$ dmesg | tail
end_request: I/O error, dev sr1, sector 196600
printk: 118 messages suppressed.
Buffer I/O error on device sr1, logical block 49150
sr 7:0:0:1: [sr1] Result: hostbyte=0x00 driverbyte=0x08
sr 7:0:0:1: [sr1] Sense Key : 0x0 [current]
sr 7:0:0:1: [sr1] ASC=0x0 ASCQ=0x0
end_request: I/O error, dev sr1, sector 196600
Buffer I/O error on device sr1, logical block 49150
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev sr1.
"Cat /dev/sr1 | xxd | less" does reveal a file system, so something is screwy in udev-land.
cfdisk indicates that sr1 is a read only device and won't show a partition table.
So, Trial and Error having failed, it seemed about time to get into some OverKill to fix matters:
Code:
# mke2fs /dev/sr1
mke2fs 1.40.8 (13-Mar-2008)
/dev/sr1: Read-only file system while setting up superblock
#
and then ...
Code:
cat /dev/urandom > /dev/sr1
That failed: the device is really read only.
Help! Panic! WTF? Should I just return the drive?
Last edited by moob8; 01-05-2009 at 01:46 PM.
Reason: moon over moskow
you have gotten hold of a very special class of device which identifies itself as more than one device. These USB sticks can be used on windows to allow autorun.inf files to be loaded on inserting the device. It uses some sort of software or firmware plus a special boot sector. What is happening is that the first partition of the drive identifies itself as a CD ROM -hence read-only. Read up by following a couple of links from below: http://clusty.com/search?input-form=...s&query=USB+U3
You should be able to access the seconf partition normally unless I am mistaken, but you may not be able to access the first one -I'm not even sure if you can wipe it out with dd, but you could try that in the end. **But**, before you do, make a backup of the bootsector! In fact, I'd love it if you'd send me a copy of the bootsector.
The reason I know about these drives is that, when they first came out, I was approached by someone about creating a special kind of stick which would contain a small linux distro in the second partition. In the first partition it would have some windows-compatible programs and/or *.bat files which would be launched by the autorun.inf file whenever the stick was inserted in a Windows box. the point was to have the stick setup the windows box as a dual boot machine. well the project never materialized -I had most of the setup already working with my AmigoXP distro, but the well-heeled fellow(really) never wanted to part with any cash or even drop by to see the thing in action. Anyway, I never got my hands on one of the devices but always wanted to have alook at the bootsector code to see how it was passing itsef off as an optical device.
dd if=/dev/sr1 of=boot.sector bs=512 count=1 should get the first sector out of it.
I'd appreciate having a copy :-)
If you have access to a windows machine, you should be able to run some included software which will let you manage that feature -changing the soze of the frist partition etc. My would-be benefactor(?) really had a great idea and I really had the way to make it work -back then he was still waiting for the price to drop below $70-$80 to make it feasible. All he ever offered me was to pay my broadband connection so I could upload a ready-to-use image which the manufacturer would then simply *flash* onto the drives. I wanted a little more than what he offered, so we never went anywhere with it -sound familiar?
You should be able to access the seconf partition normally unless I am mistaken, but you may not be able to access the first one -I'm not even sure if you can wipe it out with dd, but you could try that in the end. **But**, before you do, make a backup of the bootsector! In fact, I'd love it if you'd send me a copy of the bootsector.
I'll make a copy of the one I have and get it to you.
rworkman is right. In windows it shows up as both a CD drive and a USB drive. You can download an uninstaller from their website (which you have to run in windows). After that it appears as a normal USB drive.
gnashley, here you are: http://rlworkman.net/SDCZ6-4096RB/ (that's the model number of the drive). Just for clarity's sake, I have two of these - one of them has the U3 crap removed, and the one whose information is posted above was just unwrapped.
Thanks, Robby. I just always had the idea to see what 'magic' was being done with the bootsector to make the thing appears as a CD. I think it's interesting -like what the maekbootfat tool does to create a bootsector which can appear as USB-FDD or USB-HDD.
I've downloaded the bootsectors you provided.
If you have access to a windows machine, you should be able to run some included software which will let you manage that feature -changing the soze of the frist partition etc.
Yup: that was it. Managed to get to a machine in windows and it was as you described. Sorry, didn't get a dd of the "before" state.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.