Home » Questions » Computers [ Ask a new question ]

How to create device driver for nested partitions?

How to create device driver for nested partitions?

I'm running MSWindows virtualized with /dev/sda2 as it's primary drive. Consequently, there is a partition table on that partition, shown as:

Asked by: Guest | Views: 253
Total answers/comments: 2
bert [Entry]

"Assuming this is a straight disk image (e.g., your virtualization solution is not adding some extra metadata to things), this document (also here) offers some suggestions for accessing your partitions on /dev/sda2 (summary: use the -o offset option to losetup to create a new block device referencing the appropriate offset into sda2).

You can also use the Network Block Device (NBD) to create a partitioned block device from /dev/sda2, see this LWN article which described the process in detail. And hey, I just learned something new."
bert [Entry]

"You can also use losetup -P (--partscan) to access the partitions as /dev/loopXpY without needing to manually pass -o offsets (not sure if this was possible back in 2009):
# losetup -Pf --show /dev/sda2
/dev/loop0
$ ls /dev/loop0p*
/dev/loop0p1"