Convert-Mount-Copy-Fix
Copying a VirtualBox (in trusty) Kubuntu 15.04 installation to the real system.
Based on:
- http://superuser.com/questions/11444...l-environments
- http://askubuntu.com/questions/32499...hysical-system
1) Convert
Command is:
Using:
The image is:
2) Mount
How to: http://www.linuxquestions.org/questi...g-file-882386/
The offset is: 512 * 2048 = 1048576
Mounting with the command:
and the '/media/iso' has the virtual installation root directory mounted.
3) Copy
The new root and home - information from command: 'sudo blkid':
Mounting the /dev/sda5 (with Dolphin) to '/media/AlphaRoot/'
Copying with the rsync - 'a fast, versatile, remote (and local) file-copying tool':
4) Fix
The installation needs fixing - Few places has the information from the virtual installation:
- fstab
- grub
- old home directory
(/media/AlphaRoot)/etc/fstab
Old:
New (UUid's from the sudo blkid):
and removing the old home directory.
(/media/AlphaRoot)/boot/grub/grub.cfg
Changing (kwrite/kate find&replace) the root uuid from e668a592-7f03-4250-a537-a1ef79c0cead to ac1ecde9-89b0-4c82-8a15-2aa76b4c5ac2 - 23 replacements made.
Updating the local (trusty) grub:
This will read the information from the 15.04 grub to the local (trusty) /boot/grub/grub.cfg.
Booting and picking the Vivid...
In the Vivid updating:
Copying a VirtualBox (in trusty) Kubuntu 15.04 installation to the real system.
Based on:
- http://superuser.com/questions/11444...l-environments
- http://askubuntu.com/questions/32499...hysical-system
1) Convert
Command is:
Code:
:~$ VBoxManage internalcommands converttoraw --help Oracle VM VirtualBox Command Line Management Interface Version 4.3.10_Ubuntu (C) 2005-2015 Oracle Corporation All rights reserved. Usage: VBoxManage internalcommands <command> [command arguments] Commands: converttoraw [-format <fileformat>] <filename> <outputfile> Convert image to raw, writing to file. WARNING: This is a development tool and shall only be used to analyse problems. It is completely unsupported and will change in incompatible ways without warning.
Code:
$ VBoxManage internalcommands converttoraw Vivid.vdi vivid.img Converting image "Vivid.vdi" with size 11212398592 bytes (10693MB) to raw...
The image is:
Code:
~/VirtualBox VMs/Vivid$ fdisk -l vivid.img Disk vivid.img: 11.2 GB, 11212398592 bytes 255 heads, 63 sectors/track, 1363 cylinders, total 21899216 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x076ecf00 Device Boot Start End Blocks Id System vivid.img1 * 2048 13512703 6755328 83 Linux vivid.img2 13514750 21897215 4191233 5 Extended vivid.img5 13514752 21897215 4191232 82 Linux swap / Solaris
2) Mount
How to: http://www.linuxquestions.org/questi...g-file-882386/
The offset is: 512 * 2048 = 1048576
Mounting with the command:
Code:
sudo mount -o loop,offset=1048576 '/home/madprophet/VirtualBox VMs/Vivid/vivid.img' /media/iso
3) Copy
The new root and home - information from command: 'sudo blkid':
Code:
/dev/sda5: LABEL="AlphaRoot" UUID="ac1ecde9-89b0-4c82-8a15-2aa76b4c5ac2" TYPE="ext4" /dev/sda6: LABEL="AlphaHome" UUID="f3b54d9e-71e8-4978-8ea5-fa7da854df52" TYPE="ext4"
Copying with the rsync - 'a fast, versatile, remote (and local) file-copying tool':
Code:
sudo rsync -P -a /media/iso/ /media/AlphaRoot
4) Fix
The installation needs fixing - Few places has the information from the virtual installation:
- fstab
- grub
- old home directory
(/media/AlphaRoot)/etc/fstab
Old:
Code:
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=e668a592-7f03-4250-a537-a1ef79c0cead / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=8c9c12ff-7e00-4bab-87d4-fe124a15d59a none swap sw 0 0
Code:
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda5 during installation UUID=ac1ecde9-89b0-4c82-8a15-2aa76b4c5ac2 / ext4 errors=remount-ro 0 1 # /home was on /dev/sda6 during installation UUID=f3b54d9e-71e8-4978-8ea5-fa7da854df52 /home ext4 defaults 0 2 # /media/sda1 was on /dev/sda1 during installation UUID=db112040-6415-4614-b353-624d5eb9bd45 /media/sda1 ext4 defaults 0 2 # /media/sda14 was on /dev/sda14 during installation UUID=e9d21110-1fd7-4c5b-af37-7fa99951b2fb /media/sda14 ext4 defaults 0 2 # /media/sda2 was on /dev/sda2 during installation UUID=6374569b-646c-45c7-9e09-35c72e20e10d /media/sda2 ext4 defaults 0 2 # /media/sda3 was on /dev/sda3 during installation UUID=bc02b2ec-13fb-448b-83b5-d497010b5f7c /media/sda3 ext4 defaults 0 2 # swap was on /dev/sda13 during installation UUID=72c5fe1d-19c0-48eb-8913-e636764e92ee none swap sw 0 0
(/media/AlphaRoot)/boot/grub/grub.cfg
Changing (kwrite/kate find&replace) the root uuid from e668a592-7f03-4250-a537-a1ef79c0cead to ac1ecde9-89b0-4c82-8a15-2aa76b4c5ac2 - 23 replacements made.
Updating the local (trusty) grub:
Code:
sudo update-grub
Booting and picking the Vivid...
In the Vivid updating:
Code:
sudo update-grub