commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Creates a single primary partition starting at sector 0 and extending to the end of the disk. Use with care.
*as long as the drives are exactly the same* then this command copies the partition table on /dev/sda to /dev/sdb
Instead of calculating the offset and providing an offset option to mount, let lomount do the job for you by just providing the partition number you would like to loop mount.
Suppose you made a backup of your hard disk with dd:
dd if=/dev/sda of=/mnt/disk/backup.img
This command enables you to mount a partition from inside this image, so you can access your files directly.
Substitute PARTITION=1 with the number of the partition you want to mount (returned from sfdisk -d yourfile.img).