Export, import to different PC (OpenSuse 11.1): disk/by-id
-
AdamReed
- Posts: 7
- Joined: 14. Sep 2009, 07:13
- Primary OS: MS Windows XP
- VBox Version: OSE other
- Guest OSses: openSuse 11.1
Export, import to different PC (OpenSuse 11.1): disk/by-id
I recently tried exporting an OpenSuse 11.1 guest from my old PC (VirtualBox on Windows XP) and importing to a new one (VirtualBox on W7.) It fails to boot because it tries to mount the virtual /dev/disk/by-id, and the disk id is different on the new PC. Has anyone done this successfully? Is there anything that can be done to fix or to work around this problem?
-
MarkCranness
- Volunteer
- Posts: 875
- Joined: 10. Oct 2009, 06:27
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP
Re: Export, import to different PC (OpenSuse 11.1): disk/by-id
You have two options:
- (Recommended) rather than Export followed by Import, just copy the original VDI file, which won't have the problem.
- Re-tweak the config files: Linux (when by-id or by-uuid is used in config files) needs changes to grub tables if the drive ID (Serial No) changes (these links apply to UUID, but the same repair could be modified for use with disk ids):
The main thing in Linux for the Grub to work, it uses UUIDs to identify the root partition of your operating system, losing or corruption of this number results in it stopping the boot process. So how do we recover it? (link)
As this applies to VirtualBox: Cloning a vdi file with OpenSUSE installed - (Not recommended) You can force the new drive IDs to be the same as the old drive IDs. See section 9.16 of the user manual and use hdparm on the old VM to get the old drive IDs (SerialNo). This is not recommended because it forces the drive serial number (=by-id) based on the controller and slot rather than on the VirtualBox hd UUID which rather subverts the whole purpose of using /dev/disk/by-id in the first place.
-
AdamReed
- Posts: 7
- Joined: 14. Sep 2009, 07:13
- Primary OS: MS Windows XP
- VBox Version: OSE other
- Guest OSses: openSuse 11.1
Re: Export, import to different PC (OpenSuse 11.1): disk/by-id
Thank you, Mark. I added the symbolic links for the old id in /dev/disk/by-id and booted the system. Then replaced the old with the new ID in /boot/grub/device.map, /boot/grub/map.lst, and /etc/fstab. Then re-booted, and the system came up fine. This solves the problem. Thanks again!