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 -- Kanwar Ranbir Sandhu Linux 3.5.4-2.fc17.x86_64 x86_64 GNU/Linux 12:20:20 up 12 days, 37 min, 3 users, load average: 0.09, 0.09, 0.12
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 >
2012/10/20 Kanwar Ranbir Sandhu <m3freak at thesandhufamily.ca>> 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 > > >Hi Ranbir, please post the relevant configuration items from the guest's xml definition and the output of fdisk when done on the host.
On 10/20/2012 09:39 AM, Kanwar Ranbir Sandhu wrote:> 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".Disks don't have labels, partitions do. You don't see a partition in the KVM guest because the guest is trying to read a partition table from inside the partition that you're exporting. Instead, use one of the IDs in /dev/disk/by-id. You should see an ID that indicates the disk's model and serial number, which is usable for your purpose.