How to Use LVPM to copy Wubi-Ubuntu Desktop to a VPC Partition

Source: Internet
Author: User
Tags wubi
Wubi is the abbreviation of WindowsUbuntu-BasedInstaller, that is, virtual disk space in windows partition (NTFS), as a loop partition independent of windows, as the linux root directory /. Using LVPM (LoopmountedVirtualPartitionManager) can expand the space of a virtual disk (using the resize function of LVMP), or copy the linux system from a virtual disk to a real shard.

Wubi is short for Windows Ubuntu-Based Installer, that is, virtual disk space in windows partition (NTFS), as a loop partition independent of windows, as the linux root directory /.

You can use LVPM (Loopmounted Virtual Partition Manager) to expand the space of a Virtual disk (using the resize function of LVMP), or copy a linux system from a Virtual disk to a real Partition, implement a real windows + linux dual-system.

1. Partition

In wubi-Ubuntu, we recommend that you split the blank partitions into SWAP partitions (SWAP) in linux using the system's built-in Disk Utility. The remaining partitions are linux partitions (ext2, ext3 or ext4 format ).

Below is the data after the disk partition

Administrator @ ubuntu :~ $ Sudo fdisk-l

[Sudo] password for administrator: Disk/dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065*512 = 8225280 bytes Sector size (logical/physical): 512 bytes/512 bytes I/O size (minimum/optimal): 512 bytes/512 bytes 

 Disk identifier: 0x00000001 

Device Boot Start End Blocks Id System

 /Dev/sda1*1 1275 10241406 7 HPFS/NTFS

 /Dev/sda2 1276 1397 979965 82 Linux swap/Solaris

 /Dev/sda31398 6123 37961595 83 Linux

 /Dev/sda46124 38913 263385675 f W95 Ext 'd (LBA)

 /Dev/sda56124 16723 85144468 + 7 HPFS/NTFS

 /Dev/sda616724 27738 88477956 B W95 FAT32

 /Dev/sda727739 38913 89763156 7 HPFS/NTFS

 From the data above, we can see that the primary partition starts from/dev/sda1 and the extended partition starts from/dev/sda4. The first extended partition is/dev/sda5. let's look at the partition capacity.

Administrator @ ubuntu :~ $ Df-lh

File System capacity in use available % mount point

/Dev/sda3 36g 4.1G 30G 12%/

None 999 M 328 K 999 M 1%/dev

None 1004 M 348 K 1004 M 1%/dev/shm

None 1004 M 92 K 1004 M 1%/var/run

None 1004 M 0 1004 M 0%/var/lock

/Dev/sda1 9.8G 4.6G 5.3G 47%/media/SYS

/Dev/sda5 82G 75G 7.1G 92%/media/SOFT

/Dev/sda6 85G 75G 9.9G 89%/media/WORK

/Dev/sda7 86G 81G 4.9G 95%/media/BACK

The UUID of the partition (universal Unique Identifier is the Unique Identifier) should also be known.

Administrator @ ubuntu :~ $ Ls-al/dev/disk/by-uuid

Total 0 drwxr-xr-x 2 root 160.

Drwxr-xr-x 6 root 120 ..

Lrwxrwxrwx 1 root 10 2011-04-22 15fbe968-a73a-4b14-8315-ae841cf0d048->.../sda3

Lrwxrwxrwx 1 root 10 237D-1AF7->.../sda6

Lrwxrwxrwx 1 root 10>.../sda2lrwxrwxrwx 1 root 10 9AC4BB30C4BB0D8F-> ../sda7

Lrwxrwxrwx 1 root 10 D028BF0728BEEB9A->.../sda5

Lrwxrwxrwx 1 root 10 DE305BE6305BC3E5->.../sda1

2. Use the transfer function of the LVMP tool.

In this step, LVMP does three things: format the target partition into the ext4 format, copy the file, and install and copy grub.

Note: ModifyGrub. cfgFile

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# From/etc/grub. d and settings from/etc/default/grub
#

### BEGIN/etc/grub. d/00_header ###
If [-s $ prefix/grubenv]; then
Set have_grubenv = true
Load_env
Fi
Set default = "0"
If ["$ {prev_saved_entry}"]; then
Set saved_entry = "$ {prev_saved_entry }"
Save_env saved_entry
Set prev_saved_entry =
Save_env prev_saved_entry
Set boot_once = true
Fi

Function savedefault {
If [-z "$ {boot_once}"]; then
Saved_entry = "$ {chosen }"
Save_env saved_entry
Fi
}

Function recordfail {
Set recordfail = 1
If [-n "$ {have_grubenv}"]; then if [-z "$ {boot_once}"]; then save_env recordfail; fi
}

Function load_video {
}

If ["$ {recordfail}" = 1]; then
Set timeout =-1
Else
Set timeout = 10
Fi
### END/etc/grub. d/00_header ###

### BEGIN/etc/grub. d/05_debian_theme ###
Set menu_color_normal = white/black
Set menu_color_highlight = black/light-gray
### END/etc/grub. d/05_debian_theme ###

### BEGIN/etc/grub. d/10_linux ###
### END/etc/grub. d/10_linux ###

### BEGIN/etc/grub. d/10_lupin ###
Menuentry "Ubuntu, grub. cfg Linux 2.6.35-22-generic on/dev/sda3 "{
Insmod part_msdos
InsmodExt3
Set root = '(hd0,Msdos3)'
Search -- no-floppy -- fs-uuid -- set15fbe968-a73a-4b14-8315-ae841cf0d048
Loopback loop0/ubuntu/disks/root. disk
Set root = (loop0)
Linux/boot/vmlinuz-2.6.35-22-generic root =/dev/sda3Loop =/ubuntu/disks/root. disk ro quiet splash
Initrd/boot/initrd. img-2.6.35-22-generic
}
Menuentry "Ubuntu, grub. cfg Linux 2.6.35-22-generic on/dev/sda3 (recovery mode )"{
Insmod part_msdos
InsmodExt3
Set root = '(hd0,Msdos3)'
Search -- no-floppy -- fs-uuid -- set15fbe968-a73a-4b14-8315-ae841cf0d048
Loopback loop0/ubuntu/disks/root. disk
Set root = (loop0)
Linux/boot/vmlinuz-2.6.35-22-generic root =/dev/sda3Loop =/ubuntu/disks/root. disk ro single
Initrd/boot/initrd. img-2.6.35-22-generic
}
### END/etc/grub. d/10_lupin ###

### BEGIN/etc/grub. d/20_linux_xen ###
### END/etc/grub. d/20_linux_xen ###

### BEGIN/etc/grub. d/20_memtest86 + ###
### END/etc/grub. d/20_memtest86 + ###

### BEGIN/etc/grub. d/30_os-prober ###
Menuentry "Microsoft Windows XP Professional (on/dev/sda1 )"{
Insmod part_msdos
Insmod ntfs
Set root = '(hd0, msdos1 )'
Search -- no-floppy -- fs-uuid -- set de305be6305bc3e5
Drivemap-s (hd0) $ {root}
Chainloader + 1
}
### END/etc/grub. d/30_os-prober ###

### BEGIN/etc/grub. d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type
# Menu entries you want to add after this comment. Be careful not to change
# The 'exec tail' line above.
### END/etc/grub. d/40_custom ###

### BEGIN/etc/grub. d/41_custom ###
If [-f $ prefix/custom. cfg]; then
Source $ prefix/custom. cfg;
Fi
### END/etc/grub. d/41_custom ###
 In this step, you should note that you should change the uuid and path of the partition to the target partition (that is, the red part ). Because LVPM did not change the partition and path when copying grub.

 

You also need to modify menu. lst under \ boot \ grub.

Default = 0
Timeout = 5
Title Ubuntu-on-menu.lst/dev/sda3
Insmod part_msdos
InsmodExt3
Set root = '(hd0,Msdos3)'
Search -- no-floppy -- fs-Uuid -- set 15fbe968-a73a-4b14-8315-ae841cf0d048
Loopback loop0/ubuntu/disks/root. disk
Set root = (loop0)
Linux/boot/vmlinuz-2.6.35-22-generic root =/dev/sda3 loop =/ubuntu/disks/root. disk ro quiet splash
Kernel/boot/vmlinuz-2.6.35-22-generic ro root =/dev/sda3
Initrd/boot/initrd. img-2.6.35-22-generic



# This is a divider, added to separate the menu items below from the Debian
# Ones.
Title Other operating systems:
Root


Title UnknownOS
Root (hd0, 4)
Makeactive
Chainloader + 1
Boot


Title Microsoft Windows XP Professional
Root (hd0, 0)
Makeactive
Chainloader + 1
Boot

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.