Clone an Ubuntu installation with pmirror

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Clone an Ubuntu installation with pmirror

#1 Post by don570 »

Here is how to clone an Ubuntu installation to another disk (or partition)
using pmirror which most puppies have.

You should be able to boot the clone if grub4dos is run to install
a menu.lst file in the first partition.

When you boot up your computer you will see a screen with
'Advanced Menu'. You choose that menu and one of the
options is 'Find Grub2'. There is a wait of about 15 seconds.

You may have to press the S key to skip mounting other drives
and you may need to choose 'Restart X' . You may struggle but
you should be able to get to the Ubuntu desktop.

_______________________________________________________

I had a particularly difficult situation with a damaged Ubuntu 10.04.
Here is how I solved the cloning.

1) I booted with a CD of puppy linux. and I cloned the Ubuntu partition with pmirror.

2) I ran grub4dos (the latest version)

3) Type 'bklid' in terminal to find the identification number(UUID) of the
destination partition.

4) In the destination partition I opened /boot/grub.cfg with a text editor.
Note : there is a warning to not edit this file, but disregard this.
Using your text editor do a replacement of the old identification number
(UUID) with the new identification number several times.
It's simple to do.

5) To avoid having trouble with mounting other hard drives (partitions)
you should edit the /etc/fstab file in the destination partition.
For instance here is how I modified my fstab file. Note that I commented
out all lines except one. Now Ubuntu won't try to mount any disks except
the Ubuntu install. Note : if you know how to edit fstab properly then go ahead
and do it however this is the simplest method.

Code: Select all

proc            /proc           proc    nodev,noexec,nosuid 0       0
#/dev/sda1       /               ext3    errors=remount-ro 0       1
#UUID=daa9c35b-0dad-40e7-8cd1-6b153e9d841e none            swap    sw              0       0
#/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
#/dev/sda5 /media/300GB  ext2  defaults 0  0
6) Now when I boot the computer I choose 'Advanced menu'
and 'Find Grub2'. I wait around 15 seconds and another menu
pops up. I choose 'Restart X' and I get to Ubuntu desktop.
Use the 'mount' command in the terminal to mount other partitions.

___________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

I was able to boot an Ubuntu Trusty Tahr ISO using this method...

http://www.murga-linux.com/puppy/viewtopic.php?t=67235


1) I created a Fat32 partition (It must be 'fresh' to ensure continuous
blocks of data being read). It doesn't need the boot flag
since grub4dos will find the partition anyway.
2) Changed name to ubuntu.iso and dragged ubuntu.iso to Fat32 partition
3) Added to menu.lst on /mnt/sda1
title Ubuntu 14.4 Desktop ISO
find --set-root /ubuntu.iso
map /ubuntu.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz boot=casper iso-scan/filename=/ubuntu.iso noeject noprompt splash --
initrd /casper/initrd.lz

4) Boot your computer and chose Ubuntu 14.04 from list

5) If you log in again
user: ubuntu
password: (leave empty)

There is no need to change the boot flag of the partition. Keep the
Windows partition with the boot flag.

Warning : If you try this method on a 500 MB machine it will be too slow
to be useable. A minimum of 1 GB is necessary. I have 1.5 GB and it was
fast.

Upgrade to mtpaint at this site however
libgif
must be installed first.



_________________________________________
Last edited by don570 on Thu 17 Mar 2016, 23:47, edited 10 times in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

What bootloader are you using - GRUB2 or Grub4Dos?

Where is its stage1 installed - in the MBR or the partition bootsector?

If it's in the MBR, I don't think that you should need to change the boot flag.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#4 Post by don570 »

Grub4dos is used for the Ubuntu ISO.
/boot/boot.cfg is needed for the Ubuntu clone.
I probably don't need to change the boot flag.
I was just being cautious. I'll do a check and report back.

I should also set it up to use a swap file, which should be easy
with fstab.
_____________________________________________

gcmartin

#5 Post by gcmartin »

Hello Don570
don570 wrote:... I should also set it up to use a swap file, which should be easy with fstab.
If you have a SWAP partition instead of a file on your media, I think Tahr will find and use it. You may-not/should-not have to create a SWAP file on any media where a SWAP partition will accomplish your needs for Ubuntu and Puppy Linux. There are tons of references on how to make a SWAP partition using Linux/Puppy's gParted. With a SWAP partition, there is no need to for any system changes; thus, NO fstab requirements.

Advantage of a SWAP partition: SWAP I/Os are never done of system or data partitions.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#6 Post by don570 »

I've checked. grub4dos doesn't need the boot flag for the partition.
I should have realized :oops:

I've been using the Ubuntu install (Ubuntu Lucid) and I realized
that the original computer used a nvidia graphics card. The new computer
where I have the clone uses an Intel graphics chip.
That may explain why I need to use a 'restartx' command each time I boot up the Ubuntu partition.

________________________________________________________-

Post Reply