On Monday 24 October 2005 21:05, Alan Stern wrote:
> The patch below will cause the SCSI disk driver to bind to CD drives.
> Do "modprobe sd_mod" before plugging in the stick and see what happens.
<patch>
an update on my final thoughts on this matter. i managed to recover a lot from
the usb stick (everything maybe)... what did we do?:
i used the patch you suggested (tough i don't really know what it does :S)
i found out that there was a special devices file in the usb storage module...
so i added the following:
[EMAIL PROTECTED]:~/linux-2.6.13.4/drivers/usb/storage$ tail
unusual_devs.h
"ImageMate SDDR55",
US_SC_SCSI, US_PR_SDDR55, NULL,
US_FL_SINGLE_LUN),
#endif
UNUSUAL_DEV( 0x090c, 0x1000, 0x0000, 0xffff,
"Feiya",
"usb stick",
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_SINGLE_LUN ),
so now it thinks the device is surely a mass storage device
an fdisk showed it was a 512 meg usb stick (which it wasn't) with a corrupted
partition table. gpart tried guessing partitions, but i got a LOT of i/o
errors on the device, so the only thing that could save me...
dd if=/dev/sdb of=~/stick.out
an image of the stick. mounted it with mount -o loop ~/stick.out /mnt
which gave me what windows still had... (it seems windows just ignores the
specs to let the device tell you what kind of device it is (in this case a
zipdrive it seemed... lsusb -v said so before the patch...))
so i thought, okay, everything is gone... then i started analysing the 13 meg
dumpfile that was generated from the stick. i know the stick contained only
word documents, so i took a document, saw that the first 4 bytes were: d0cf
11e0... so that could be used as a way to know where your files start. by
using the following commands, i got a list of all the starting places of word
docs:
xxd stick.out |grep "d0cf 11e0" | awk '{print $1}'|sed 's/:$//' > docpos
but... that only gives you hex numbers, unusable in dd, so...
for i in `cat docpos `; do (echo "ibase=16"; echo ${i} |tr "a-z" "A-Z") | bc;
done > decpos
now the file decpos gives you all the decimal offsets of the wordfiles.
now we can substrace the next from the previous to know how many bytes all the
docs are... i put it all in a csv file containing 3 fields: $1(sequential
numbers for filenames), $2 (offset in the "image"), $3 (length of the docent)
script did: dd if=~/stick.out of=${1}.doc bs=1 skip=${2} count=$[3}
that gave me 205 docfiles, the last one had to be done by hand.
please notice this was a long shot! (no fragmentation, only office documents
(beginning with d0cf11e0). but anyway... we got 206 docs now, and a usb stick
that's completely dead.
i don't know if we got all of it, but that's the most i could get out of the
stick. i hope this information is useful if someone else has a similar
problem, or can learn something from this, if he/she has a problem with a
device.
anyway, i would like to thank alan stern for his help here! (i owe you a beer!
(if you're going to 22c3, i'll give it to you there :))
it was a very pleasant experience while having bad luck with a usb stick!
remember... if all software fails... use the hex force! ;)
/me signing off now! see you all later! :)
--
harry
aka Rik Bobbaers
K.U.Leuven - LUDIT -=- Tel: +32 485 52 71 50
[EMAIL PROTECTED] -=- http://harry.ulyssis.org
Disclaimer:
By sending an email to ANY of my addresses you are agreeing that:
1. I am by definition, "the intended recipient"
2. All information in the email is mine to do with as I see fit and make
such financial profit, political mileage, or good joke as it lends itself to.
In particular, I may quote it on usenet.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality that may be
included on your message.
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users