[aklug] Re: Using DD to find partition table

From: James <marblemunkey@gmail.com>
Date: Tue Nov 20 2012 - 14:48:22 AKST

I really like Leif's idea. The other option that occured to me was rather
than using dd with the offset, you could use a loop device, setting the
offset.

Assuming that you don't have any loop devices in use, your loop then
becomes:
 i=1; while true; do losetup -d /dev/loop0; losetup -o $i --sizelimit 512
/dev/loop0 fake-sdb; echo $i; file -s /dev/loop0; i=$((i+1)); done 2>&1 |
grep -B1 /dev/loop0 | grep -i -B1 'boot sector'

you can then use losetup on your actual drive to access a single partition,
if you want:
losetup -o $offset --sizelimit $partionsize /dev/loop0 /dev/sdb

>
>

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Nov 20 14:48:31 2012

This archive was generated by hypermail 2.1.8 : Tue Nov 20 2012 - 14:48:31 AKST