[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Xen with LVM


  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "IDAGroup - R.W.Muller" <robin@xxxxxxxxxxx>
  • Date: Thu, 11 Oct 2007 21:30:05 -0400
  • Delivery-date: Thu, 11 Oct 2007 18:31:17 -0700
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Hello Errol, I tried that and get a little weird partition table:

 sfdisk -l -uS /dev/vms/centos5_data

Disk /dev/vms/centos5_data: 0 cylinders, 0 heads, 0 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/255/63 (instead of 0/0/0).
For this listing I'll assume that geometry.
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/vms/centos5_data1   *        63   3068414    3068352  83  Linux
/dev/vms/centos5_data2             0         -          0   0  Empty
/dev/vms/centos5_data3             0         -          0   0  Empty
/dev/vms/centos5_data4             0         -          0   0  Empty

But other then that, it works like a charm:

[root@serv106 mnt]# mount -o loop,ro,offset=$(( 512*63 )) /dev/vms/centos5_data /mnt/centos/
[root@serv106 mnt]# ls -al /mnt/centos/
total 184
drwxr-xr-x 21 root root  4096 Oct 11 21:20 .
drwxr-xr-x  3 root root  4096 Oct 11 21:21 ..
drwxr-xr-x  2 root root  4096 Oct 11 21:08 bin
drwxr-xr-x  3 root root  4096 Oct 11 21:06 boot
drwxr-xr-x  2 root root  4096 Oct 11 20:59 dev
drwxr-xr-x 70 root root  4096 Oct 11 21:20 etc
-rw-r--r--  1 root root     0 Oct 11 21:20 halt
drwxr-xr-x  2 root root  4096 Mar 29  2007 home
drwxr-xr-x 14 root root  4096 Oct 11 21:08 lib
drwx------  2 root root 16384 Oct 11 20:59 lost+found
drwxr-xr-x  2 root root  4096 Oct 11 21:15 media
drwxr-xr-x  2 root root  4096 Mar 29  2007 mnt
drwxr-xr-x  2 root root  4096 Mar 29  2007 opt
drwxr-xr-x  2 root root  4096 Oct 11 20:59 proc
drwxr-x---  2 root root  4096 Oct 11 21:20 root
drwxr-xr-x  2 root root 12288 Oct 11 21:07 sbin
drwxr-xr-x  2 root root  4096 Oct 11 20:59 selinux
drwxr-xr-x  2 root root  4096 Mar 29  2007 srv
drwxr-xr-x  2 root root  4096 Oct 11 20:59 sys
drwxrwxrwt  3 root root  4096 Oct 11 21:14 tmp
drwxr-xr-x 13 root root  4096 Oct 11 21:04 usr
drwxr-xr-x 19 root root  4096 Oct 11 21:07 var
[root@serv106 mnt]#

Now I just have to find out, how I can get ride of the Empty partitions and how to use snapshot for backup and I'm getting closer
to a usable result :)

Thank you very much Errol!
Robin


Errol Neal wrote:
Quoting "IDAGroup - R.W.Muller" <robin@xxxxxxxxxxx>:

Ok, I guess it has not really something to do with LVM, cause I just
installed a (working!)
Centos5 guest into a (also working) Centos5 dom0 as imagefile. When I
try to mount the image
I get:

[root@serv106 ~]# mount -o loop /disk.img /mnt/loop/
mount: you must specify the filesystem type

So, very similar to the error before (actually the same). What is wrong
with my guest installation
that those are booting fine, but are not mountable?

Thanks for any help here,
Robin


This is because you are attempting to mount the entire disk.
use sfdisk -l -uS /disk.img to determine what sector the partition you wish to mount starts at. then mount it with the offset option. For example:

server30:/etc/xen/vm # ls /dev/xendata/
volume0  volume1  volume2  volume3
server30:/etc/xen/vm # sfdisk -l -uS /dev/xendata/volume3

Disk /dev/xendata/volume3: 0 cylinders, 0 heads, 0 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/255/63 (instead of 0/0/0).
For this listing I'll assume that geometry.
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/xendata/volume3p1   *        63  20964824   20964762   7  HPFS/NTFS
/dev/xendata/volume3p2      20964825 125821079  104856255   7  HPFS/NTFS
                start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/xendata/volume3p3             0         -          0   0  Empty
/dev/xendata/volume3p4             0         -          0   0  Empty
server30:/etc/xen/vm # mount -o loop,ro,offset=$(( 512*63 )) /dev/xendata/volume3 /mnt/windows/
server30:/etc/xen/vm # ls /mnt/windows
AUTOEXEC.BAT            Inetpub        System Volume Information  pagefile.sys
CFusionMX7              MSDOS.SYS      WINDOWS                    qpmd8378.bin
CONFIG.SYS              NTDETECT.COM   boot.ini
Documents and Settings  Program Files  msizap.exe
IO.SYS                  RECYCLER       ntldr

If you image contains a LVM partition, then it becomes a bit more complicated.
Use losetup with the offset option to loop your image/partition
Use pvscan to scan the loopback device
Use vgchange -ay to activate the volumes
Mount the volumes.

Let me know if that answers your question..

-Errol


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.