[CentOS] Assign external esata drive to KVM

Sun Oct 21 00:54:25 UTC 2012
Banyan He <banyan at rootong.com>

You can try sfdisk or use the other utility to see if the tag is able to 
recognized. The problem here you have is the partition table is 
corrupted as you can find your hardware path but no partition can be 
found. Or, you can use fdisk to reformat the disk again, this would work 
as well. There is no point to use USB in this case.

Banyan He
Blog: http://www.rootong.com
Email: banyan at rootong.com

On 2012-10-21 12:39 AM, Kanwar Ranbir Sandhu wrote:
> Hello Everyone,
> I have a CentOS 6.3 host running a few KVMs.  One of them is a CentOS
> 6.3 KVM that I want to use for making backups with BackupPC.  What I'm
> having a problem with is assigning the KVM an external drive.
> I used to run BackupPC on an Ubuntu box. The backups went to an external
> eSATA 1.5TB, ext4 format, single partition drive (regular 3.5" in an
> enclosure).  I want to now attach that same external drive to my KVM
> host, and pass it up to the KVM running BackupPC.
> I added the entire drive as a second storage disk to the KVM. I used the
> disk's label (/dev/disk/by-label/backups) so that I wouldn't have to
> worry about the device name changing down the road.  When I booted up
> the KVM and listed the disks, I only saw "/dev/vdb". I was also
> expecting to see "/dev/vdb1".
> I ran fdisk on it only to see the partition table wasn't detected.  The
> drive itself is OK - I can mount it successfully on the KVM host.
> Here's the fdisk output:
> Device contains neither a valid DOS partition table, nor Sun, SGI or OSF
> disklabel
> Building a new DOS disklabel with disk identifier 0xd6912a1b.
> Changes will remain in memory only, until you decide to write them.
> After that, of course, the previous content won't be recoverable.
> Warning: invalid flag 0x0000 of partition table 4 will be corrected by
> w(rite)
> WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
>           switch off the mode (command 'c') and change display units to
>           sectors (command 'u').
> Command (m for help): p
> Disk /dev/vdb: 1500.3 GB, 1500300861440 bytes
> 16 heads, 63 sectors/track, 2907018 cylinders
> Units = cylinders of 1008 * 512 = 516096 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0xd6912a1b
>     Device Boot      Start         End      Blocks   Id  System
> Command (m for help): quit
> So...how do I properly assign this eSATA disk to the KVM?  FYI: the
> enclosure can use USB as well.
> Thanks,
> Ranbir