RIP Thinkpad / Mount partition of whole-disk-dd-image
My IBM Thinkpad T41 is no more.
I don't like Passwords, so I use cryptographic Certificates. They are all stored on the Thinkpads HDD, along with all my Mails and Stuff, so I'm pretty much separated from the outside world since the Laptop died last Friday.
Sure I do have backups, but they were 200km away from me (or i was 200km away from my filer, spoken correctly) and they were 12h old. So I headed back home and connected the Laptops HDD to my Workstation via USB and dumped the HDD contents via dd:
dd if=/dev/sdh | split -db2024m thinkpad.dd.iso.
(had to use split becuz I stored it on a FAT32 external USB drive)
Now comes the tricky part: I now have no working Laptop left, so I decided to split my Workstations RAID10 into 4 single drives and install one OS per drive: WindowsXP, OpenSolaris, Ubuntu and Gentoo. The Gentoo Installation should be an exact copy of my Laptops Setup, so when I have my new Laptop I keep them in sync via rsync and when my laptop breaks again I'll lose neither data nor time to restore.
So I installed Ubuntu and copied the HDD Image to my home dir there
cat thinkpad.dd.iso.* > ~/thinkpad.dd.iso
My plan was to mount the FS and edit the config files in order to get a booting image. But as you saw above, I dumped the whole HDD, not the separate partitions.
What to do now?
Well, its easy when you hit on it:
Use the losetup Offset Option!
fdisk will tell you the correct byte offset
(in this case 512*2116800=1083801600)
# losetup /dev/loop0 thinkpad.dd.iso
# fdisk -lu /dev/loop0
Disk /dev/loop0: 40.0 GB, 40007761920 bytes
240 heads, 63 sectors/track, 5168 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x78db8e1b
Device Boot Start End Blocks Id System
/dev/loop0p1 * 63 120959 60448+ 83 Linux
/dev/loop0p2 120960 2116799 997920 82 Linux swap / Solaris
/dev/loop0p3 2116800 78140159 38011680 83 Linux
# losetup -d /dev/loop0
# losetup -o1083801600 /dev/loop0 thinkpad.dd.iso
# mount -t reiserfs /dev/loop0 /mnt/
And thats it!
I hope this little hack will save you time somewhen.

thanks
thanks
Cool Tip!
Really great hack! I have no money for the bear for myself :) but if I have ....
It REALLY helped me! THANKS!
Nice to know about losetup.
Nice to know about losetup. You don't have to use it in this case, though. Try:
sudo mount -o loop,offset=$((2116800 * 512)) thinkpad.dd.iso /mnt/
Well, you need to know the
Well, you need to know the offset in eighter case. how would you tell w/o losetup?
fdisk -lu thinkpad.dd.iso
fdisk -lu thinkpad.dd.iso
This and similar
This and similar information-sharing my vocabulary expanded again. Thank you for your writing ...
That's a great idea. But it
That's a great idea. But it will be nice if you give some more information about it. I've looked for it at different blogs and search engines (my favourite one is http://rapid4me.com , it always helps me) but I didn't find much. It must be your invention. Cool!
Being a Daniel Webster
Being a Daniel Webster Scholar alışveriş gave me confidence in sigarayı bırakma çayı - sigarayı bırakma yöntemleri - sigaranın zararları - nikotinsiz sigara bırakma - sigara bırakma - sigarayı bırakma - sigarayı bırakmak için - sigarayı bırakma yolları - sigara bırakmanın yolları - en etkili sigara bırakma yöntemi - sigarayı bırakmanın yolları bitkisel my ability to practice law. More importantly, my employers knew because I was erkek giyim bayan giyim bayan giyim erkek giyim doğal ürünler a Webster Scholar, pet shop I could handle a Supreme Court appeal.” As a Daniel Webster Scholar, giyim he was evaluated each semester by a New Hampshire Bar bilgisayar Examiner, counseled clients under supervision, appeared before judges, and developed his saç bakım , saç dökülmesi , bitkisel saç bakım skills and judgment in clinical settings. oto aksesuar The program is unique alisveris in the nation.
Post new comment