I have a working DomU when located on a physical partition (i.e. hdb, a 
2nd HD that I''m using to stage guest domains), but it all goes bad when
I copy the root/swap partitions into LVM-based partitions.  
Specifically, I have a working guest domain on hdb2 (swap is hdb1).  I 
created the logical volumes using the usual mix of pvcreate, vgcreate, 
and lvcreate:
    pvcreate /dev/hda5vgcreate xen-vg /dev/hda5
    lvcreate -L5G -n suse-root xen-vg
    mkfs.reiserfs /dev/xen-vg/suse-root
    cp -ax /<the real parition> /<the new partition> (yes, this
seemed
    to work as expected)
    lvcreate -L256M -n suse-swap xen-vg
    mkswap /dev/xen-vg/suse-swap
The only other modification I made was to the start-up script as follows:
    < disk = [ ''phy:xen-vg/suse-root,hdb2,w'',
    ''phy:xen-vg/suse-swap,hdb1,w'' ]
    ---
     > disk = [ ''phy:hdb2,hdb2,w'',
''phy:hdb1,hdb1,w'' ]
Now when I start the same domain copied (per the `cp -ax` listed above) 
into the LVM I get:
    Linux version 2.6.11.4-20a-xen (geeko@buildhost) (gcc version 3.3.5
    20050117 (prerelease) (SUSE Linux)) #1 Wed Mar 23 21:52:37 UTC 2005
    BIOS-provided physical RAM map:
     Xen: 0000000000000000 - 0000000010000000 (usable)
    0MB HIGHMEM available.
    256MB LOWMEM available.
    DMI not present.
    IRQ lockup detection disabled
    Allocating PCI resources starting at 10000000 (gap: 10000000:f0000000)
    Built 1 zonelists
    Kernel command line:  root=/dev/hdb2 ro 3
    Initializing CPU#0
    PID hash table entries: 2048 (order: 11, 32768 bytes)
    Xen reported: 1594.860 MHz processor.
    Using tsc for high-res timesource
    Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    Memory: 253056k/262144k available (1876k kernel code, 8808k
    reserved, 558k data, 128k init, 0k highmem)
    Checking if this processor honours the WP bit even in supervisor
    mode... Ok.
    Security Framework v1.0.0 initialized
    SELinux:  Disabled at boot.
    Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
    CPU: Trace cache: 12K uops, L1 D cache: 8K
    CPU: L2 cache: 256K
    CPU: Intel(R) Pentium(R) 4 CPU 1600MHz stepping 0a
    Enabling fast FPU save and restore... done.
    Enabling unmasked SIMD FPU exception support... done.
    Checking ''hlt'' instruction... disabled
    checking if image is initramfs... it is
    Freeing initrd memory: 2882k freed
    NET: Registered protocol family 16
    PCI: Using configuration type Xen
    Linux Plug and Play Support v0.97 (c) Adam Belay
    xen_mem: Initialising balloon driver.
    PCI: Probing PCI hardware
    PCI: Probing PCI hardware
    PCI: Probing PCI hardware (bus 00)
    TC classifier action (bugs to netdev@oss.sgi.com cc hadi@cyberus.ca)
    audit: initializing netlink socket (disabled)
    audit(1127899476.096:0): initialized
    Total HugeTLB memory allocated, 0
    VFS: Disk quotas dquot_6.5.1
    Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    Initializing Cryptographic API
    vesafb: abort, cannot reserve video memory at 0x0
    vesafb: abort, cannot ioremap video memory 0x0 @ 0x0
    Trying to free nonexistent resource <00000000-ffffffff>
    vesafb: probe of vesafb.0 failed with error -5
    isapnp: Scanning for PnP cards...
    isapnp: No Plug & Play device found
    PNP: No PS/2 controller found. Probing ports directly.
    i8042.c: No controller found.
    io scheduler noop registered
    io scheduler anticipatory registered
    io scheduler deadline registered
    io scheduler cfq registered
    RAMDISK driver initialized: 16 RAM disks of 64000K size 1024 blocksize
    loop: loaded (max 8 devices)
    Xen virtual console successfully installed as tty
    Event-channel device installed.
    xen_blk: Initialising virtual block device driver
    xen_net: Initialising virtual ethernet driver.
    mice: PS/2 mouse device common for all mice
    NET: Registered protocol family 2
    IP: routing cache hash table of 2048 buckets, 16Kbytes
    TCP established hash table entries: 16384 (order: 5, 131072 bytes)
    TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
    TCP: Hash tables configured (established 16384 bind 16384)
    NET: Registered protocol family 1
    NET: Registered protocol family 8
    NET: Registered protocol family 20
    Freeing unused kernel memory: 128k freed
    Starting udev
    Creating devices
    Loading kernel/drivers/ide/ide-core.ko
    Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
    ide: Assuming 50MHz system bus speed for PIO modes; override with
    idebus=xx
    Loading kernel/drivers/ide/pci/piix.ko
    Loading kernel/drivers/ide/ide-disk.ko
    Loading kernel/drivers/cdrom/cdrom.ko
    Loading kernel/drivers/ide/ide-cd.ko
    Loading kernel/fs/reiserfs/reiserfs.ko
    Waiting for device /dev/hdb2 to appear:  ok
    rootfs:  major=3 minor=66 devn=834
    fsck 1.36 (05-Feb-2005)
    Reiserfs super block in block 16 on 0x342 of format 3.6 with
    standard journal
    Blocks (total/free): 1310720/1139665 by 4096 bytes
    Filesystem is clean
    Replaying journal..
    Reiserfs journal ''/dev/hdb2'' in blocks [18..8211]: 0
transactions
    replayed
    Checking internal tree..finished
    fsck succeeded. Mounting root device read-write.
    Mounting root /dev/hdb2
    ReiserFS: hdb2: found reiserfs format "3.6" with standard journal
    ReiserFS: hdb2: using ordered data mode
    reiserfs: using flush barriers
    ReiserFS: hdb2: journal params: device hdb2, size 8192, journal
    first block 18, max trans len 1024, max batch 900, max commit age
    30, max trans age 30
    ReiserFS: hdb2: checking transaction log (hdb2)
    reiserfs: disabling flush barriers on hdb2
    ReiserFS: hdb2: Using r5 hash to sort names
    No init found. Try passing init= optino to the kernel.
    umount2: Device or resource busy
    Kernel panic - not syncing: Attempted to kill init!
     <0>Rebooting in 1 seconds..
Any suggestions?
Kent
_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Kent Watsen wrote:> > > I have a working DomU when located on a physical partition (i.e. hdb, a > 2nd HD that I''m using to stage guest domains), but it all goes bad when > I copy the root/swap partitions into LVM-based partitions. > Specifically, I have a working guest domain on hdb2 (swap is hdb1). I > created the logical volumes using the usual mix of pvcreate, vgcreate, > and lvcreate: > > pvcreate /dev/hda5vgcreate xen-vg /dev/hda5 > lvcreate -L5G -n suse-root xen-vg > mkfs.reiserfs /dev/xen-vg/suse-root > cp -ax /<the real parition> /<the new partition> (yes, this seemed > to work as expected)Sorry, I am confused by this. Are you copying a filesystem image or a tree of files on a mounted filesystem? The absence on any mount commands suggests the former. The presence of the mkfs.reiserfs command suggests the latter. Incidently I tend to avoid using cp because I can never remember how it works. I tend to dd to copy disk images and a pair of tar commnds in a pipeline to copy file trees around.> lvcreate -L256M -n suse-swap xen-vg > mkswap /dev/xen-vg/suse-swap > > The only other modification I made was to the start-up script as follows: > > < disk = [ ''phy:xen-vg/suse-root,hdb2,w'', > ''phy:xen-vg/suse-swap,hdb1,w'' ] > --- > > disk = [ ''phy:hdb2,hdb2,w'', ''phy:hdb1,hdb1,w'' ]I am using xen-2.0.7 For my domU configuration file I have: disk = [ ''phy:/dev/system/domU1_root,hda1,w'', ''phy:/dev/system/domU1_swap,hda2,w''] i.e. are you missing a /dev/ prefix somewhere? I''m not sure this is causing you a problem though, it just seems better to use an explicit path. If you fsck and mount your LVM filesystem images, do they check OK, mount OK, contain all the files you expect to be there? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, 2005-09-28 at 11:22 +0100, Robbie Dinn wrote:> Kent Watsen wrote: > > > > > > I have a working DomU when located on a physical partition (i.e. hdb, a > > 2nd HD that I''m using to stage guest domains), but it all goes bad when > > I copy the root/swap partitions into LVM-based partitions. > > Specifically, I have a working guest domain on hdb2 (swap is hdb1). I > > created the logical volumes using the usual mix of pvcreate, vgcreate, > > and lvcreate: > > > > pvcreate /dev/hda5vgcreate xen-vg /dev/hda5 > > lvcreate -L5G -n suse-root xen-vg > > mkfs.reiserfs /dev/xen-vg/suse-root > > cp -ax /<the real parition> /<the new partition> (yes, this seemed > > to work as expected) > > Sorry, I am confused by this. Are you copying > a filesystem image or a tree of files on a mounted > filesystem? > > The absence on any mount commands suggests the former. > The presence of the mkfs.reiserfs command suggests the latter. > > Incidently I tend to avoid using cp because I can never > remember how it works. I tend to dd to copy disk images > and a pair of tar commnds in a pipeline to copy file trees > around.hehe, I used to do that as well, cp -a (archive).> > > lvcreate -L256M -n suse-swap xen-vg > > mkswap /dev/xen-vg/suse-swap > > > > The only other modification I made was to the start-up script as follows: > > > > < disk = [ ''phy:xen-vg/suse-root,hdb2,w'', > > ''phy:xen-vg/suse-swap,hdb1,w'' ] > > --- > > > disk = [ ''phy:hdb2,hdb2,w'', ''phy:hdb1,hdb1,w'' ] > > I am using xen-2.0.7 > > For my domU configuration file I have: > > disk = [ ''phy:/dev/system/domU1_root,hda1,w'', > ''phy:/dev/system/domU1_swap,hda2,w''] > > i.e. are you missing a /dev/ prefix somewhere? > > I''m not sure this is causing you a problem though, > it just seems better to use an explicit path. > > If you fsck and mount your LVM filesystem images, > do they check OK, mount OK, contain all the > files you expect to be there? > > _______________________________________________Make sure your kernel has lvm support, check back in the list for more details on this. Regards, Ted _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
>> I have a working DomU when located on a physical partition (i.e. hdb, >> a 2nd HD that I''m using to stage guest domains), but it all goes bad >> when I copy the root/swap partitions into LVM-based partitions. >> Specifically, I have a working guest domain on hdb2 (swap is hdb1). >> I created the logical volumes using the usual mix of pvcreate, >> vgcreate, and lvcreate: >> >> pvcreate /dev/hda5vgcreate xen-vg /dev/hda5 >> lvcreate -L5G -n suse-root xen-vg >> mkfs.reiserfs /dev/xen-vg/suse-root >> cp -ax /<the real parition> /<the new partition> (yes, this seemed >> to work as expected) > > > Sorry, I am confused by this. Are you copying > a filesystem image or a tree of files on a mounted > filesystem? > > The absence on any mount commands suggests the former. > The presence of the mkfs.reiserfs command suggests the latter. > > Incidently I tend to avoid using cp because I can never > remember how it works. I tend to dd to copy disk images > and a pair of tar commnds in a pipeline to copy file trees > around.Yes, there were some mount commands also - I was trying to save the list some of the details, but they were something like: mkdir /mnt/hdb; mount /dev/hdb1 /mnt/hdb1 mkdir /mnt/suse-root; mount /dev/xen-vg/suse-root /mnt/suse-root then the `cp` was like: cp -ax /mnt/hdb1 /mnt/suse-root and, of course, after the copy finished, I cleaned up as follows: umount /mnt/hdb1; rmdir /mnt/hdb1 umount /mnt/suse-root; rmdir /mnt/suse-root>> lvcreate -L256M -n suse-swap xen-vg >> mkswap /dev/xen-vg/suse-swap >> >> The only other modification I made was to the start-up script as >> follows: >> >> < disk = [ ''phy:xen-vg/suse-root,hdb2,w'', >> ''phy:xen-vg/suse-swap,hdb1,w'' ] >> --- >> > disk = [ ''phy:hdb2,hdb2,w'', ''phy:hdb1,hdb1,w'' ] > > > I am using xen-2.0.7 > > For my domU configuration file I have: > > disk = [ ''phy:/dev/system/domU1_root,hda1,w'', > ''phy:/dev/system/domU1_swap,hda2,w''] > > i.e. are you missing a /dev/ prefix somewhere? > > I''m not sure this is causing you a problem though, > it just seems better to use an explicit path. > > If you fsck and mount your LVM filesystem images, > do they check OK, mount OK, contain all the > files you expect to be there?From the user-guide, this appears to be the right syntax when using LVM - besides, the guest boot was almost successful... Kent _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> hehe, I used to do that as well, cp -a (archive). > >This is what another xen-enthusist had posted on his blog...> Make sure your kernel has lvm support, check back in the list for more > details on this. > >Initially, I thought that this suggestion was spot-on, but then I looked at the tail-end of the trace (below) and it seems that the kernel mounted the LVM-based filesystem OK: Waiting for device /dev/hdb2 to appear: ok rootfs: major=3 minor=66 devn=834 fsck 1.36 (05-Feb-2005) Reiserfs super block in block 16 on 0x342 of format 3.6 with standard journal Blocks (total/free): 1310720/1139665 by 4096 bytes Filesystem is clean Replaying journal.. Reiserfs journal ''/dev/hdb2'' in blocks [18..8211]: 0 transactions replayed Checking internal tree..finished fsck succeeded. Mounting root device read-write. Mounting root /dev/hdb2 ReiserFS: hdb2: found reiserfs format "3.6" with standard journal ReiserFS: hdb2: using ordered data mode reiserfs: using flush barriers ReiserFS: hdb2: journal params: device hdb2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 ReiserFS: hdb2: checking transaction log (hdb2) reiserfs: disabling flush barriers on hdb2 ReiserFS: hdb2: Using r5 hash to sort names No init found. Try passing init= optino to the kernel. umount2: Device or resource busy Kernel panic - not syncing: Attempted to kill init! <0>Rebooting in 1 seconds.. In case anybody is wondering, I''m using the stock Xen-kernel that shipped with Suse 9.3... One thing I thought might be notable was that it suprised me that the "root" line didn''t change - that is, in the LVM-based config file, the root is still set to "/dev/hdb2 ro" Any other suggestions? Kent _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
One of of listers gave me a hint offline that led me to the fix.
After mounting the volume directly I discovered that it had
an "hdb1" sub-dir!  Essentially, instead of:
    cp -ax /mnt/hdb1 /mnt/suse-root
I should have called:
    cp -ax /mnt/hdb1/* /mnt/suse-root
Thanks for all the help!
Kent
_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Kent Watsen <kent@watsen.net> writes:> I should have called: > > cp -ax /mnt/hdb1/* /mnt/suse-rootUsing cp with multiple (esp. directory) arguments often does not exactly what one expects, because it works very similar to for d in /mnt/hdb1/*; do cp -ax $d /mnt/suse-root; done and that means, a file that is hardlinked in several of these directories will not be hardlinked in the copy, but instead you will have multiple copies of it. I have sometimes used something like cp -ax /mnt/hdb1 /mnt/suse-root mv /mnt/suse-root/hdb1/* /mnt/suse-root rmdir /mnt/suse-root/hdb1 instead but usually I prefer using tar that doesn''t have this problem (or dd if copying whole block devices as in your case). Having hardlinks between different top-level directories is very unlikely it''s not a problem in this case but you should always remember this behavior when cp''ing multiple directories. urs _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users