In part-1, I discussed how to mount a read-only NTFS USB drive into your XenServer filesystem.
In this week's installment, I'll talk about Formatting a USB drive exclusively for XenServer.
If you wanted to dedicate a USB drive to your XenServers, you could format it with a Linux filesystem. That way you could use it as storage to backup your VMs, and restore them on other machines if needed. Assuming you know the device name of the partition you want to use, use the following as an example command:
mkfs -v -t ext3 /dev/sdc1
Warning: Doing this will destroy any existing data on the partition, and you will not be able to use this disk on a Windows machine without reformatting it using Windows Disk Manager: You have been warned!
As always, with any Linux command you can use the online manual (if it's installed), for example:
man mkfs
Once formatted, you can mount this device into the filesystem, as shown previously in part-1. Now you can read and write to the drive, as in this following example which will backup a VM to the external USB drive:
xe vm-export vm='W2K8 DC' filename='/mnt/backups/W2K8 DC.xva'
Come back next week, and I'll talk about Accessing CIFS shares in XenServer.
Comments (4)
Mar 22, 2009
Anonymous says:
Not bad Olivier...I must say I've always been impressed when it comes to documen...Not bad Olivier...I must say I've always been impressed when it comes to documents or articles, regarding technical detail, that you write. Plus the adversity of products that you know astounds me that you can still manage to keep it all straight. Good job!
Brian C.
Oct 05
Anonymous says:
Olivier, Have any users reported an error like this: [root@xenserver ...Olivier,
Have any users reported an error like this:
[root@xenserver ~]# fdisk -l
Disk /dev/cciss/c0d0: 293.5 GB, 293563949056 bytes
255 heads, 32 sectors/track, 70265 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes
Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 981 4002464 83 Linux
/dev/cciss/c0d0p2 982 1962 4002480 83 Linux
/dev/cciss/c0d0p3 1963 70265 278676240 83 Linux
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 121601 976760001 c W95 FAT32 (LBA)
[root@xenserver ~]# mkfs -v -t ext3 /dev/sda1
mke2fs 1.39 (29-May-2006)
mkfs.ext2: invalid blocks count - /dev/sda1
Oct 06
Anonymous says:
Olivier, Just an FYI. I fixed this problem by attaching the disk to...Olivier,
Just an FYI. I fixed this problem by attaching the disk to an Ubuntu laptop and formatting it there.
Must be a bug somewhere in XenServer's linux ?
Oct 06
Olivier Withoff says:
Interesting. I've never tried to format a drive by the partition device, when th...Interesting. I've never tried to format a drive by the partition device, when that partition is the whole disk. I would have simply formatted /dev/sda. Thanks for the update, Olivier.
Add Comment