PDA

Bekijk de volledige versie : HOW-TO say Open Sesame to your External disk



robink
24-04-2008, 09:50
As I noticed my WL700gE doesn't have the performance I wanted, I decided to use a <5W Linux System (Geode LX 800, 256 MB memory, VGA, Audio, USB, LAN) to serve as my NAS / DLNA / Web Server / MLDonkey / Internet Radio etc etc..

So after installing the basic Linux I took my nice 750GB USB Hard drive which was attached to my WL700gE and connected it to my Linux system... bummer!! I wasn't able to do anything with it! As I didn't feel like copying all the data to another disk, reformat and copy everything back... I went looking for a solution...

Than I found the "HOW-TO say Open Sesame to your Internal disk", inspired by that Thread (http://wl500g.info/showthread.php?p=60036) (which didn't have a satisfying solution for me) I looked beyond...

I looked at the first sector of the disk and found "Broadcom NAS Version 1.1 MBR Tag".. With the help of Google I found: http://blog.stevecoinc.com/2007_12_01_archive.html

In short, for those who want to recover some information of the disk:
I managed to mount the file system (read only or even write only) with a few easy steps and no risk of ruining the information! (Do the steps below as root!)

1) Find the location of the super block so the file system can be mounted.
For me the disk was available under /dev/sda
I installed hexedit (ubuntu: apt-get install hexedit)
Run hexedit on the device: hexedit /dev/sda
Than use TAB to get into the ASCII Part of the Data (otherwise it will search HEX Values) and type "/" (without quotes) to search. Search for "ReIsEr" (again without quotes).
Note (piece of paper) the HEX value at the start of the line and change the last 2 digits to 00. (For me it was at 0011430, so I noted 0x11400 down)
Change the HEX value to decimal (70656) and subtract 65536 (super block is 64K before the found (zeroed) value) which leaves 5120 for me.

2) Mount the file system read only by using an offset in the mount:
mount -t reiserfs -o ro,loop,offset=<offset> <usb device> <mountpoint>
Or without the readonly flag for those who need to change their files... (leave the "ro," out)
For me this would be:
mount -t reiserfs -o ro,loop,offset=5120 /dev/sda /mnt/usb

And behold... your files!!!





For those who don't have the loop option in the mount command, please generate your own loop device:
EXTRA:
Setup a loop device with the calculated offset so we can use the new loop device to mount the file system:
losetup -o <found offset> <loop device> <usb device>
First find a freed loop device by using: "losetup -f", for me it was the /dev/loop1.
Than use the found offset, loop device and usb device in the command, for me this was the used command:
losetup -o 5120 /dev/loop1 /dev/sda
Than mount that with normal options...

(If this was to hard or the one from SteveCo didn't help, try: https://www.blogger.com/comment.g?blogID=8108277809937554792&postID=7410585480231306306 maybe that will explain it better?)

Tonight I will try if I can write a normal partition table to the disk with fdisk so I can mount it without creating the loop device (and therefor making it a "permanent" mount). For this I will use the information in the Thread that inspired this one. [Edit: As I don't need it anymore, I can specify the offset in my fstab.. I will probably not persue this]

Hope this brings you something... I you have any questions let me know!

P.S.
My new System is able to serve my files (reading) with SAMBA over 100Mbit LAN at a stable 9MB/s even up to 10MB/s :D
(Compared to a max of 4MB/s for the WL700gE, which gets even worse when I have mldonkey and Twonky running!)
Still have to look what's wrong with writing as this is only 200KB/s :(
I think the Disk is mounted without the async option, need to look into it.

Best regards,
Robin