I am trying to develop a procedure for backup and restore of a Xen PVM. I am having a problem with booting the restored machine. I''ll tell you the symptom, and then what I''m doing to get to that symptom. When I boot the VM, it panics with a message that says: "According to mtab, /dev/xvda2 is already mounted on /sysroot" I don''t understand exactly what this means, so i don''t know what to look at to fix it. Here is what I''m doing: First, I''m working with Oracle VM Server 3, which uses Xen 4.1.2. I know Linux fairly well, but I don''t know much about Xen yet. I understand that the kernel in a VM is booted from outside the VM at startup time, and that grub in the VM is NOT used, except for providing the grub.conf file that is used to determine which kernel to boot. IS THIS TRUE? Anyhow, I have assumed this true, and am trying to "clone" a PVM in the following way: 1. Backup all the files on the two partitions of my real VM. These are ''/'' and ''/boot''. 2. Create a new virtual disk and attach it to a running VM. 3. Partition the disk to match the one I''m cloning. 4. Create the / and /boot filesystems. 5. Run mkswap on the swap partition. 6. Restore the files backed up in step 1 to the new disk. 7. Edit /etc/fstab on the new disk, and put in the new UUIDs. 8. Edit /boot/grub/grub.conf on the new disk, and change the "root=UUID=..." parameter to point to the root filesystem on the new disk. 9. Create a new VM, make the new disk the boot disk, and boot it. Note that did NOT do anything to the MBR, nor did I install grub on the disk. DO I NEED TO? In any case, the new VM does boot, and does know what the root partition should be. But then it panics with the message above, and I don''t know what to do next. I have added the "rdshell" parameter to the kernel line in grub.conf, and have looked around, but I don''t see anything obviously wrong. Can some smart Xen Person please assist me?
On Tue, 2012-12-11 at 16:30 +0000, Terry Phelps wrote:> I am trying to develop a procedure for backup and restore of a Xen > PVM. I am having a problem with booting the restored machine. I''ll > tell you the symptom, and then what I''m doing to get to that symptom. > > When I boot the VM, it panics with a message that says: > > "According to mtab, /dev/xvda2 is already mounted on /sysroot"On the face of it this doesn''t look especially like a Xen specific issue, google comes up with a bunch of instances of people having this sort of problem without Xen. Probably your best bet is OVM support. /etc/mtab is the place where mount stores what it has done (i.e. the current set of mounted filesystems). A lot of distros link this to /proc/mounts these days. Sounds as if you have backed up whatever the state was at the time and restoring it has confused something. Really I''d have said OVM ought to cope by clearing mtab at an appropriate time during boot.> Note that did NOT do anything to the MBR, nor did I install grub on > the disk. DO I NEED TO?Not for a PV VM, only HVM guests need an MBR.> Can some smart Xen Person please assist me?One thing I did spot on google was make sure your root= is the UUID of the / not the /boot filesystem. Ian.
On Tue, Dec 11, 2012 at 11:38 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:> On Tue, 2012-12-11 at 16:30 +0000, Terry Phelps wrote: >> I am trying to develop a procedure for backup and restore of a Xen >> PVM. I am having a problem with booting the restored machine. I''ll >> tell you the symptom, and then what I''m doing to get to that symptom. >> >> When I boot the VM, it panics with a message that says: >> >> "According to mtab, /dev/xvda2 is already mounted on /sysroot" > > On the face of it this doesn''t look especially like a Xen specific > issue, google comes up with a bunch of instances of people having this > sort of problem without Xen. Probably your best bet is OVM support.I''m not alleging that Xen is the problem. I posted this on the Xen list mainly to determine whether there might be some other step that I need to do, so that my disk would boot properly under Xen. And yes, I''ve googled a bit on this problem, but I still can''t figure out why the kernel is panicking.> One thing I did spot on google was make sure your root= is the UUID of > the / not the /boot filesystem.I did check that. It''s definitely pointing to the right partition. I''ll keep looking at it.
Silly question: ( and im asking because I tried it )after you finished working with the vm image you unmounted it before you tried to boot it? Adrian On Dec 12, 2012 2:33 AM, "Terry Phelps" <tgphelps50@gmail.com> wrote:> I am trying to develop a procedure for backup and restore of a Xen > PVM. I am having a problem with booting the restored machine. I''ll > tell you the symptom, and then what I''m doing to get to that symptom. > > When I boot the VM, it panics with a message that says: > > "According to mtab, /dev/xvda2 is already mounted on /sysroot" > > I don''t understand exactly what this means, so i don''t know what to > look at to fix it. > > Here is what I''m doing: > First, I''m working with Oracle VM Server 3, which uses Xen 4.1.2. I > know Linux fairly well, but I don''t know much about Xen yet. > > I understand that the kernel in a VM is booted from outside the VM at > startup time, and that grub in the VM is NOT used, except for > providing the grub.conf file that is used to determine which kernel to > boot. IS THIS TRUE? > > Anyhow, I have assumed this true, and am trying to "clone" a PVM in > the following way: > 1. Backup all the files on the two partitions of my real VM. These are > ''/'' and ''/boot''. > 2. Create a new virtual disk and attach it to a running VM. > 3. Partition the disk to match the one I''m cloning. > 4. Create the / and /boot filesystems. > 5. Run mkswap on the swap partition. > 6. Restore the files backed up in step 1 to the new disk. > 7. Edit /etc/fstab on the new disk, and put in the new UUIDs. > 8. Edit /boot/grub/grub.conf on the new disk, and change the > "root=UUID=..." parameter to point to the root filesystem on the new > disk. > 9. Create a new VM, make the new disk the boot disk, and boot it. > > Note that did NOT do anything to the MBR, nor did I install grub on > the disk. DO I NEED TO? > > In any case, the new VM does boot, and does know what the root > partition should be. But then it panics with the message above, and I > don''t know what to do next. I have added the "rdshell" parameter to > the kernel line in grub.conf, and have looked around, but I don''t see > anything obviously wrong. > > Can some smart Xen Person please assist me? > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users