Hi all,
I am trying to mount images that I previously created with dd and the images have two partitions (swap and LVM). I use these images to house data for my Xen Guests.
For some reason (possibly Kernel conflicts for paravirtualized domains) I am unable to boot my Guest images. Failing which I would like to mount the disk images and atleast get my data out of them.
dd -o loop server.img /media/diskimage
asks me to provide a file system. How can I mount these images?
I have been Googling around for this and have failed to find and answer, can someone please point me in the right direction.
Appreciate your time.
Devraj Mukherjee wrote:
Hi all,
I am trying to mount images that I previously created with dd and the images have two partitions (swap and LVM). I use these images to house data for my Xen Guests.
You'll probably need at least kpartx to mount the partitions out of the image. Maybe even the LVM tools, if you've created some of the filesystems inside the image as LVs.
Perhaps the page at the following may give you some inspiration: http://www.centos.org/docs/5/html/Virtualization-en-US/ch-virt-accessing-dat...
-Alan
Is your local host using LVMs and if so, is your volume group something like VolGroup00?
Is your image file also of a VolGroup00?
- aurf On Sep 26, 2009, at 7:56 PM, Devraj Mukherjee wrote:
Hi all,
I am trying to mount images that I previously created with dd and the images have two partitions (swap and LVM). I use these images to house data for my Xen Guests.
For some reason (possibly Kernel conflicts for paravirtualized domains) I am unable to boot my Guest images. Failing which I would like to mount the disk images and atleast get my data out of them.
dd -o loop server.img /media/diskimage
asks me to provide a file system. How can I mount these images?
I have been Googling around for this and have failed to find and answer, can someone please point me in the right direction.
Appreciate your time.
-- "The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi aurf,
On Sun, Sep 27, 2009 at 1:09 PM, aurfalien@gmail.com wrote:
Is your local host using LVMs and if so, is your volume group something like VolGroup00?
Yes it uses LVM and has VolGroup00
Is your image file also of a VolGroup00?
- aurf
Yes this is true as well.
Ok, this is what I did in the exact same situation (solution below gotten from the xen list).
I use it religiously.
Lucky I'm on both forums.
**********************************************
First make sure your guest isn't running unless you want to trash its file systems.
losetup -f /var/lib/xen/images/foo.img losetup -a # Make a note of which device corresponds to /var/lib/images/foo.img, # 'll call it /dev/loopN but it's probably /dev/loop0 kpartx -va /dev/loopN
You'll get two new entries in /dev/mapper now: /dev/mapper/loopNp1 and /dev/mapper/loopNp2. loopNp1 is /boot (asume you have got a standard layout). loopNp2 is a volume group. You can just mount /dev/loopNp1 to poke around the /boot file system.
Now
vgscan
This is where you might come unstuck. The default volume group for Red Hat and similar is "VolGroup00". If your dom0 is using LVM and so is the guest then you'll have do VolGroup00's and that's bad. The best thing to do now is to boot a rescue image in a different domU and rename the guest's volume group. You'll need to undo the kpartx and losetup (see below first) and when you've all finished then you'll need to either fix up the guest's /boot/initrd*.img, /etc/fstab and / boot/grub/grub.conf to hold the new name or you'll have to rename it back again in the rescue guest.
Anyway, assuming you don't get a clash:
vgchange -ay VolGroup00
The guest's file systems are now in /dev/VolGroup00 and you can mount them as normal.
To undo everything:
1. umount any file systyems you mounted 2. vgchange -an VolGroup00 3. kpartx -d /dev/loopN 4. losetup -d /dev/loopN
And next time you build a system, change the name of its volume group so you don't wind up with two systems with the same volume group name! And I wish Red Hat had listened to me years ago when I said that "VolGroup00" was a really poor idea.
**********************************************
On Sep 26, 2009, at 8:11 PM, Devraj Mukherjee wrote:
Hi aurf,
On Sun, Sep 27, 2009 at 1:09 PM, aurfalien@gmail.com wrote:
Is your local host using LVMs and if so, is your volume group something like VolGroup00?
Yes it uses LVM and has VolGroup00
Is your image file also of a VolGroup00?
- aurf
Yes this is true as well.
-- "The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks a lot for that, I will give it a go. I am trying to get another machine with CentOS 5.3 so I can use that to perform the rescue operations.
Did you see my post on the virtualisation list?
If so do you have any thoughts on that post?
On Sun, Sep 27, 2009 at 1:16 PM, aurfalien@gmail.com wrote:
Ok, this is what I did in the exact same situation (solution below gotten from the xen list).
I use it religiously.
Lucky I'm on both forums.
Well, I would build a new system with no LVMs at all, just set everything as / and ext3.
This way you can rescue img files all day long without potential VolGroup00 clashes.
I build all my Xen dom0 and domUs w/o LVMs.
Why?
Cuz I found a bug (I guess, or its just lame) that wen your snapshot volume of your / goes away, and you reboot the system, you can't.
This dependancy on snapshots turned me off and I couldn't find a quick way to recover in case of some DR or BCP need.
- aurf
On Sep 26, 2009, at 8:21 PM, Devraj Mukherjee wrote:
Thanks a lot for that, I will give it a go. I am trying to get another machine with CentOS 5.3 so I can use that to perform the rescue operations.
Did you see my post on the virtualisation list?
If so do you have any thoughts on that post?
On Sun, Sep 27, 2009 at 1:16 PM, aurfalien@gmail.com wrote:
Ok, this is what I did in the exact same situation (solution below gotten from the xen list).
I use it religiously.
Lucky I'm on both forums.
-- "The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
o, i didn't see your post in the xen lists.
On Sep 26, 2009, at 8:21 PM, Devraj Mukherjee wrote:
Thanks a lot for that, I will give it a go. I am trying to get another machine with CentOS 5.3 so I can use that to perform the rescue operations.
Did you see my post on the virtualisation list?
If so do you have any thoughts on that post?
On Sun, Sep 27, 2009 at 1:16 PM, aurfalien@gmail.com wrote:
Ok, this is what I did in the exact same situation (solution below gotten from the xen list).
I use it religiously.
Lucky I'm on both forums.
-- "The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
I have absolutely no clue why this is.
Have you tried taking that img file and its config to another dom0 to see what happens?
Try to have 2 xen dom0s set aside for testing, one at current production level and what at bleeding edge.
This way you can test exsisitng domUs on both to see what happens.
Sorry i have nothing real good to add tho.
Did you see my post on the virtualisation list?
If so do you have any thoughts on that post?
On Sun, Sep 27, 2009 at 1:16 PM, aurfalien@gmail.com wrote:
Ok, this is what I did in the exact same situation (solution below gotten from the xen list).
I use it religiously.
Lucky I'm on both forums.
-- "The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Unsure what xen you are on.
But I was using the stock version supplied by Centos and found that latest 3.4.1 rpms found at the gitco repo ( http://www.gitco.de/ repo/ ) fixed a lot of my problems.
Centos/RHEL use 3.1.2 which blowz.
On Sep 26, 2009, at 8:21 PM, Devraj Mukherjee wrote:
Thanks a lot for that, I will give it a go. I am trying to get another machine with CentOS 5.3 so I can use that to perform the rescue operations.
Did you see my post on the virtualisation list?
If so do you have any thoughts on that post?
On Sun, Sep 27, 2009 at 1:16 PM, aurfalien@gmail.com wrote:
Ok, this is what I did in the exact same situation (solution below gotten from the xen list).
I use it religiously.
Lucky I'm on both forums.
-- "The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Am Sonntag, den 27.09.2009, 05:16 +0200 schrieb aurfalien@gmail.com:
Ok, this is what I did in the exact same situation (solution below gotten from the xen list).
I use it religiously.
Lucky I'm on both forums.
First make sure your guest isn't running unless you want to trash its file systems.
losetup -f /var/lib/xen/images/foo.img losetup -a # Make a note of which device corresponds to /var/lib/images/foo.img, # 'll call it /dev/loopN but it's probably /dev/loop0 kpartx -va /dev/loopN
At that point you should be also able to rename the VG using its UID.
Chris
financial.com AG
Munich head office/Hauptsitz München: Maria-Probst-Str. 19 | 80939 München | Germany Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany Management board/Vorstand: Dr. Steffen Boehnert (CEO/Vorsitzender) | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender) Register court/Handelsregister: Munich – HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553