1

I use a raw block (whole disk like /dev/sdb1) as KVM virtual disk. Anyone know how to mount that partition from the host?

My testdisk output is like this:

~# testdisk /list /dev/sdb1
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Please wait...
Disk /dev/sdb1 - 500 GB / 465 GiB - CHS 60801 255 63
Sector size:512
Model: WDC WD5000HHTZ-04N21V1, S/N:WD-WXJ1EA3JNLK3, FW:04.06A01

Disk /dev/sdb1 - 500 GB / 465 GiB - CHS 60801 255 63
 Partition          Start        End    Size in sectors
 1 P HPFS - NTFS              0  32 33 60800 237 45  976764928
 NTFS, blocksize=4096

I tried to mount like - mount -t nfs /dev/sdb1 /mnt/mydrive

does not work.

Any suggestions would be appreciated.

Spooler
  • 7,046
  • 18
  • 29
Gene
  • 11
  • 1

1 Answers1

0

You have a nested partition table. You're going to have to make a loop device at a the needed offset of sdb1.

This output is giving values in CHS. You should display this using sectors instead, using fdisk or parted. However, it looks like this is a zero bit offset. I'll assume this is the case unless you verify otherwise

losetup /dev/loop0 /dev/sdb1

This will create the loop device you need, binding /dev/sdb1 to the first loop device /dev/loop0. Once you've done this, you can create partitions out of that. You can do this using partprobe:

# partprobe /dev/loop0

This will spawn devices like /dev/loop0p1. At this point, you should be able to mount this nested partition directly:

# mount /dev/loop0p1 /mnt/mydrive

Spooler
  • 7,046
  • 18
  • 29