LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices

Reply
 
Search this Thread
Old 03-13-2010, 06:53 PM   #1
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 196Reputation: 196
Cloning Linux Mint HOWTO


I'm lazy so I don't like to install the same system on a few machines. I install it once and then clone using tar and gzip. With Slackware and LILO it's simple. With Linux Mint and Grub it's a bit tricky.

To clone the system you have to:

1. Archive it on some external device with tar and gzip using first machine and Linux live distribution.

2. Restore it from that external device using second machine and Linux live distribution.

In both cases I used Linux Mint as a live distribution.

3. Next you have to update /etc/fstab file to reflect actual partitioning scheme on the second machine.

During fstab setup you need valid UUID partitions numbers. The numbers displays a command sudo blkid. This is the first trick.

4. Finally you have to update Grub.

Let's assume the restored system is on /dev/sda1 and you want to install Grub on /dev/sda. In order to do it perform these commands (I assume you use Linux Mint live distribution):

Code:
# sudo mount /dev/sda1 /mnt/
# sudo mount --bind /dev /mnt/dev/
# sudo mount --bind /proc /mnt/proc/
# sudo chroot /mnt/
# update-grub
# grub-install /dev/sda
The trick is in the second command. It mounts current devices in mounted directory allowing to install Grub on the disk. Without that step grub-install /dev/sda command displays an error:

Code:
grub-probe: error: cannot find a device for /boot/grub.
***

At the end you may want to change host name and local IP address in /etc/motd, /etc/fstab, /etc/hosts, /etc/hostname, /etc/printcap, and /etc/network/interfaces files.

Last edited by w1k0; 10-26-2010 at 08:21 PM.
 
Old 03-14-2010, 06:00 PM   #2
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
Why not use something like partimage? Much simpler for most people... Or even G4L?
 
Old 03-15-2010, 01:54 PM   #3
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 196Reputation: 196
As I know both these programs can copy partitions. The simpler way to do it is just to use dd with gzip. But copying file systems has two advantages over copying partitions. First: the resulting compressed image is significantly smaller. Second: you can restore that image on a partition of any size.

In the past for some time I copied Windows XP partition with dd and gzip. When I restored it on the partition bigger than the original one the resulting partition was equal in size to the original one and I was unable to change its size. Now I copy Windows XP partition using tar and gzip and I can restore it on the partition of any size. The only difficulty is with preparing new partition for Windows installation. Linux tools can't format FAT32 partition as bootable, so I have to start Windows XP installation, allow the setup program to format a partition and then break the installation and restore the system from my archive file.

I wrote above more about Windows than about Linux because in the past (thirteen years ago and before) I had a lot of work with installing Windows from scratch. I did it hundreds times and it was painful. When I invented dd and gzip method it was a great progress. Later I invented tar and gzip method and it was even greater progress.
 
Old 03-15-2010, 07:16 PM   #4
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
No offence mate, but G4L will do everything you describe and more, it will do a dd clone of a complete drive, including all partitions, and filesystems. gparted will mark a VFAT partition bootable if you need that functionality.
 
Old 03-15-2010, 07:53 PM   #5
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 196Reputation: 196
I don't see nothing offending in your words. My knowledge about G4L yesterday evening was limited to the sentence ``G4L is a hard disk and partition imaging and cloning tool'' that I read here. You increased it a bit. Thank you. As for GParted I didn't know it allows to mark FAT partitions as bootable. I tried to use it twice for some other purpose and it failed. Now I know I can use it instead of running and stopping Windows installation just to format the partition. Thank you once again.

Finally I can't agree that running GParted or G4L and using any of them is simpler than commands such as tar czf /somewhere/something.tar.gz * and tar xf /somewhere/something.tar.gz. These two commands are models of simplicity. Each Linux distribution includes tar and gzip. You haven't to install unknown application and to learn it. You haven't to prepare Live CD and to learn another unknown application. Just run the first command on the source machine and run the second command on the target machine. That's all folks!
 
Old 07-21-2010, 05:13 AM   #6
kindofabuzz
Member
 
Registered: Mar 2010
Location: Memphis, TN
Distribution: Linux Mint 13, Ubuntu Server 10.04
Posts: 230

Rep: Reputation: 42
http://clonezilla.org/
 
Old 05-28-2013, 05:44 PM   #7
toddbailey
LQ Newbie
 
Registered: Jul 2004
Location: seattle
Posts: 16

Rep: Reputation: 1
Exclamation

I use dd to copy the partitions it's basically dd -if= source device -of=destination device.

You'll need to prepare the new drive before hand, in my case create the /boot, swap and / partitions.

Once this is done however, to make the new disk bootable and the os files loadable, you'll need to update the grub loader files.
/boot/grub/grub.conf, and the /etc/fstab file, with the new disk guid id numbers, you can get them from ls -la /dev/disk/by-uuid

Once I have these files updated, I think you can reboot and begin using the new drive, after a bios change to point to the new drive.
I think you still need to update grub through another means to make the new drive fully bootable,
I'll need to research this in more detail. but this is a start.

Cloaning partitions would work unless you remove the old disk and replace it with the new disk, in my case both the old and new drives will remain on the system.

Last edited by toddbailey; 05-28-2013 at 05:49 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie with Mint/ Linux needs to install Clam AV in Mint after 4 Wdws Trogan attack BAKEAPPLEFARM Linux Mint 6 03-24-2010 08:38 PM
Newbie with Mint/ Linux would like to iinstall WINE on Mint so found no help for this BAKEAPPLEFARM Linux Mint 4 05-08-2009 08:33 AM
How do I replace Linux Mint with Suse 11.0 on PC with Win XP Mint and Ubuntu? jremsen Linux - Software 4 02-15-2009 06:54 AM
re installation of grub in Linux mint after installing xp over mint sampad.sarangi General 1 01-15-2008 05:37 PM


All times are GMT -5. The time now is 07:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration