Cloning LM 11 on 10 computers

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
User avatar
Eucalyptus
Level 3
Level 3
Posts: 125
Joined: Thu May 14, 2009 9:50 am
Location: Canada

Cloning LM 11 on 10 computers

Post by Eucalyptus » Mon Aug 29, 2011 10:02 pm

Hi,

To install LM 11 x64 on 10 brand new machines. What is the best way to proceed? What I would like to do is to prepare & customize the GUI for 1 machine. Then clone the hard drive to the other 9 machines. Then I just need to change the computer name, user name. I wonder if Linux OS needs a SID to differentiate a machine from the others on the network (like SID in Windows).

Can you please recommend a procedure to safely clone a Linux machine?

Thanks in advance for any help.

User avatar
Aging Technogeek
Level 13
Level 13
Posts: 4581
Joined: Sun Jan 11, 2009 9:54 am
Location: Right about here

Re: Cloning LM 11 on 10 computers

Post by Aging Technogeek » Mon Aug 29, 2011 10:32 pm

Either Remastersys (http://www.geekconnection.org/remastersys/), or Clonezilla (http://clonezilla.org/) will do the job. Remastersys has a practical limit of 4 GB, but, in my opinion is the easier to learn and use.

Also, the newer versions of Gparted include a partition cloning function that may do what you want.

I just found this site http://www.linuxlinks.com/article/20100 ... ng.html%5C. It lists six of the best Linux OS cloning programs. Check them out.
Registered Linux User 483387

remoulder
Level 17
Level 17
Posts: 7642
Joined: Fri May 09, 2008 1:14 pm
Contact:

Re: Cloning LM 11 on 10 computers

Post by remoulder » Tue Aug 30, 2011 4:44 am

Eucalyptus wrote:wonder if Linux OS needs a SID to differentiate a machine from the others on the network
No linux doesn't need such artificial devices, SIDs are more to do with Microsoft's licence enforcement than needed to identify machines.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.

wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: Cloning LM 11 on 10 computers

Post by wayne128 » Tue Aug 30, 2011 6:40 am

Eucalyptus wrote:Hi,

To install LM 11 x64 on 10 brand new machines. What is the best way to proceed?

Can you please recommend a procedure to safely clone a Linux machine?
For me , I would just use my lazy method :
I always use gparted to clone a working installation after tweak to USB drive's unallocated space.

The procedure is simple, little learning curve as long as you know how to handle gparted.
just run Live CD, run gparted, choose the installed partition, COPY, choose the USB unallocated space, PASTE, apply.
Now I have a clone on USB drive.

To install onto new comp, plug USB drive onto comp, boot comp with Live CD, run gparted, point to USB clone partition, COPY, point to new comp unallocated space, PASTE, apply.
When gparted completes, just install boot loader to MBR


One additional note here to save time:
copy and paste in gparted is like 'dd command' but in GUI form but without the MBR, so in order to save time on the procedure for 10 computers, it is advisable to minimise your installation partition which will become your clone.

For me, I would just install Linux OS to ONE partition only, this simplify works, then after tweaking, perhaps the size of the 'installation' would be in just about 4-6G, if your installed partition is very large, like 100G, the copy/paste will waste too much time to copying blank, 10 computers will take too long.

So what I would do is to shrink the installed partition to as min as possible, says it is just 6G, then clone it to USB drive with 6G.
To copy a 6G partition would takes just a few minutes!!
100G can take more than 1 hour!! and it just wastes time.

Afterall, once you paste 6G to each computer, you can let gparted resize 6G to whatever size you wish, resizing 6G to 100G would take very short time, I think just few minutes.

User avatar
Eucalyptus
Level 3
Level 3
Posts: 125
Joined: Thu May 14, 2009 9:50 am
Location: Canada

Re: Cloning LM 11 on 10 computers

Post by Eucalyptus » Tue Aug 30, 2011 12:45 pm

Hi Gentlemen,

Thank you for your help. I will try to review the tools you have advised. Gparted's cloning function seems interesting but I am a little lost following Wayne's instructions. Can you please clarify:
wayne128 wrote:When gparted completes, just install boot loader to MBR
How do you do that? Boot from Live CD and type something?
wayne128 wrote:For me, I would just install Linux OS to ONE partition only, this simplify works, then after tweaking, perhaps the size of the 'installation' would be in just about 4-6G, if your installed partition is very large, like 100G, the copy/paste will waste too much time to copying blank, 10 computers will take too long.
The hard drive has 300 GB. I prefer 4 partitions (/boot 200M ext2, / 15 GB ext4, swap = same size than installed RAM, and /home etx4 taking the remaining storage space). After install of the LM 11 x64 used as model. I suppose the sum of data of all the partitions above is around 5 GB. I would like to avoid single partition. Can GParted handle the partition layout I described above?
wayne128 wrote:So what I would do is to shrink the installed partition to as min as possible, says it is just 6G, then clone it to USB drive with 6G.
I suppose "shrink" here means, on the "model" computer, create a 6GB partition and install LM11 on it? Or make no change on the "model" computer and use a software utility to compress or make a big partition to appear to be around 6GB?
wayne128 wrote:Afterall, once you paste 6G to each computer, you can let gparted resize 6G to whatever size you wish, resizing 6G to 100G would take very short time, I think just few minutes.
Does this method work with the 4 partitions layout described above?

thenewguy
Level 3
Level 3
Posts: 186
Joined: Thu Feb 04, 2010 9:29 pm

Re: Cloning LM 11 on 10 computers

Post by thenewguy » Tue Aug 30, 2011 5:02 pm

I highly recommend using CloneZilla Live. It'll let you clone a partition or an entire disk (including the MBR). Just put the CD in the drive of the machine you want to copy and follow the steps on the screen to copy the disk/partition. Then go to each of the other machines, put the CloneZilla CD in the drive and follow the steps for restoring a disk/partition. The defaults almost always work. Check out their website for documentation: http://clonezilla.sourceforge.net/

The nice thing about clonezilla is it can save images onto a disk or SMB or secure shell server, making it handy if you're working on a network. With a small stack of CDs and a fast LAN you can image dozens of machines over the network at once.

Inkit
Level 5
Level 5
Posts: 679
Joined: Fri Jun 25, 2010 4:44 am

Re: Cloning LM 11 on 10 computers

Post by Inkit » Tue Aug 30, 2011 11:09 pm

Just subscribing to the thread. Really interesting concept from wayne.

wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: Cloning LM 11 on 10 computers

Post by wayne128 » Wed Aug 31, 2011 1:01 am

Does this method work with the 4 partitions layout described above?
Sure, no reason of not working.
It is just copy and paste. The simple ones always work.
Just like how people copy windows folders from one drive to another.
Here you copy all partitions, then install boot loader, that is about it.

But then you want to have four partitions and it just make things more complex, because you need to do it four times! or may be just three times because there is no meaning of copying SWAP . Also you probably need to know a bit of what gparted would assign when it pastes a new partition copied from elsewhere.
Complex also in the way you need to make sure all cloned computers have the same partition layout. If not you will have trouble because partition numbers will be different!!

My lazy method works well if
1. one OS per partition, to simplify thing and save lots of time and OS can be anywhere, any hard disk, internal or external.
2. small OS partition, making copying very fast and reinstallation equally fast.
3. need to just install grub at MBR, quite simple procedure really

Please reconsider using Clonezilla. Read up their procedure, a little more learning curve.



Here I shall answer your questions and provide a slight more details on how to do, if you choose to use gparted method.Remember YMMV :mrgreen:


wayne128 wrote: The hard drive has 300 GB. I prefer 4 partitions (/boot 200M ext2, / 15 GB ext4, swap = same size than installed RAM, and /home etx4 taking the remaining storage space). After install of the LM 11 x64 used as model. I suppose the sum of data of all the partitions above is around 5 GB. I would like to avoid single partition. Can GParted handle the partition layout I described above?

I suppose "shrink" here means, on the "model" computer, create a 6GB partition and install LM11 on it? Or make no change on the "model" computer and use a software utility to compress or make a big partition to appear to be around 6GB?
It is up to you to partition your 'model computer'. When I use my lazy method, I do not care what partition of reinstallation and do not care where it is, primary, logical, etc, always work.

If you want to use gparted method, with 4 partitions you MUST ensure all computers have the SAME partition layout or else you have some trouble later on. Afterall you want to clone 10 computers then having them all with the SAME partition layout is important anyway.

Now you want to have on model computer:
/boot 200M , ext2
/ 15G, ext4,
/SWAP
/home 280G , ext4
assuming each computer has only one hard disk, two internal hard disk complicate issues.

Here is my view and method only, partitioning has many working methods.
I suggest following method for efficiency purposes based on my experience with gparted , OS clone and reinstallation of clones to different comps.

There is no need to copy SWAP. just format it as SWAP that is all.
Setting it as first partition simplify copy and paste because gparted always assign new partition with next available partition number.

There is no worry on boot partition, it is just 200M and would complete copy and paste in less than one minute.

Now left two bigger partitions.
/ is 15G, copying would take something like 15-40 minutes depending on your CPU and hardware speed. For simplicity I would suggest simply stay with your planned 15G and just spend that time for cloning.

Now the last one, 280G,
copy 280G would take too long compare to just copy 2G!.
I would not want to use dd or gparted to copy 280G when I can shrink ( or resize) it to save time.

So If I were to do this job, I will not even want to put /home with 280G, I would just give it enough for customisation, I do not know how much you need for your case, but lets assume 3G is good enough, so I would just give /home 3G and let the rest of the hard disk as unallocated.

It is very easy and fast to resize /home later from 3G to 280G or whatever space left in the hard disk since another computer might well have 1TB hard disk :lol: so putting /home at the last partition simplify the post-installation step of growing it to cover all unallocated space.


If you are not sure how much it would take on /home, then just let it be 280G first, after you are satisfied with your customisation, just use gparted to resize or shrink the 280G to minimum, gparted can tell you what that minimum is. Then leave the rest of the hard disk as unallocated.

So now you have model computer with

/SWAP , 6G, /dev/sda1 ==for the reason I am lazy and look for efficiency
/boot , 200M, ext2 /dev/sda2 ==keep it your way
/ , 15G , ext4 /dev/sda3 ==keep it your way
/home, 3G , ext4 /dev/sda4 == adjusted for fast copy, fast paste, fast reinstallation
the rest of hard disk is unallocated

Then get a USB drive, have enough unallocated space.

The procedure would be:

Copy from Model comp to USB drive

1. Plug in USB drive, run gparted on Live CD
2. Nothing to do on copying SWAP. which is /dev/sda1
3. copy from model comp /dev/sda2. paste to USB unallocated space. see that gparted will assign its own partition number in USB drive
4. repeat step 3 for /dev/sda3
5. repeat step 3 for /dev/sda4
6. now you have USB drive having cloned partition for /dev/sda2,3,4 and there are called clone2/clone3 and clone4. You just take note of where they are in gparted graphically, actually since you have different size and ext2 for boot it is very easy to remember where they are in USB drive , there are in sequence anyway.

Install from Clone to new comp

7. now to install on new computer, run Live CD, ensure hard disk is unallocated or just format it. Then add the first partition with SWAP with the size you determined.
gparted will assign SWAP to /dev/sda1, remember I do this to illustrate and putting SWAP first simpify thing.
The rest of the hard disk space remain unallocated.
8. plug in USB drive. run gparted and now you see the Clone2,3,4
9. copy from USB drive Clone2, paste to new comp unallocated space.
gparted will copy the whole partition over and when complete would assign its number to /dev/sda2.
10. copy from USB drive clone3, paste to new comp unallocated space, gparted will copy the whole clone3 and when complete it will assign it to /dev/sda3
11. copy from USB drive clone4, paste to new comp unallocated space, gparted will copu the whole clone4 and when complete it will assign it to /dev/sda4
12. Now the copy and paste complete.

Time to install grub to MBR

13. To install grub to MBR, as your /boot is at /dev/sda2, there are two commands on terminal, first is to mount boot partition , second is to install grub to MBR
13.1 sudo mount /dev/sda2 /mnt
13.2 sudo grub-install --root-directory=/mnt /dev/sda
14. When grub is installed as above, it should report 'no error'. when this happens you can reboot the new comp and check it works.

Time for post-installation resizing of /home

15. Now that new comp is working, you need to extend your /home partition to cover bigger space or cover the rest of the unallocated space, just use gparted and resize to your requirement.

Good luck
wayne128 wrote:When gparted completes, just install boot loader to MBR
How do you do that? Boot from Live CD and type something?
this is answered on step 13 above.

User avatar
Eucalyptus
Level 3
Level 3
Posts: 125
Joined: Thu May 14, 2009 9:50 am
Location: Canada

Re: Cloning LM 11 on 10 computers

Post by Eucalyptus » Wed Aug 31, 2011 10:11 am

Hi Wayne,

Thank you very much for the time you put to write down the detailed steps. Moderators, if you are around, this man deserves a medal for his helpfulness. The initial cloning question has been fully addressed. But now, thanks to the gparted details, I have ... other questions about partition techniques. Hope you can still give me another lesson :)
wayne128 wrote:gparted will assign SWAP to /dev/sda1, remember I do this to illustrate and putting SWAP first simpify thing.
Does that means, the recommended practice is to place SWAP partition as the last one? Currently, that is what I always do. In spite in the post above I listed it 3th in the 4 partition layout.
wayne128 wrote:/SWAP , 6G, /dev/sda1 ==for the reason I am lazy and look for efficiency
/boot , 200M, ext2 /dev/sda2 ==keep it your way
/ , 15G , ext4 /dev/sda3 ==keep it your way
/home, 3G , ext4 /dev/sda4 == adjusted for fast copy, fast paste, fast reinstallation
the rest of hard disk is unallocated
Q1. Why is putting SWAP partition in /dev/sda1 efficient? Would that be a "strategic" partition for booting?

Q2. Looks like you configure all partitions as primary partitions. Is there any reason? FYI, When using gparted on a brand new hard drive. I created /dev/sda1 200 M, ext2 for /boot. Gparted assigned it as primary parition. On subsequent partitions, gparted defaults them as logical partitions (primary option unchecked). I have heard of a limit of 4 primary partitions max, but why would gparted default to logical partition right after the very first primary partition?

Thanks in advance for any help.

wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: Cloning LM 11 on 10 computers

Post by wayne128 » Wed Aug 31, 2011 6:48 pm

wayne128 wrote:gparted will assign SWAP to /dev/sda1, remember I do this to illustrate and putting SWAP first simpify thing.
Does that means, the recommended practice is to place SWAP partition as the last one? Currently, that is what I always do. In spite in the post above I listed it 3th in the 4 partition layout.
Q1. Why is putting SWAP partition in /dev/sda1 efficient? Would that be a "strategic" partition for booting?
Not really, SWAP can be anywhere, can be in primary or logical.
For those with many internal drives and multiboot lots of OS, they have many SWAP in each hard disk,, too complicated to discuss.

I did that for simple reason of easy to illustrate the procedure.
That is the 'efficiency' I referred to :mrgreen: :lol:

It is upto you to create your partition layout.
The above procedure is easier to understand in details.

Whatever layout you choose , as long as it works on Model computer, you just modify the procedure to clone them into new computer.

Just need to pay attention to UUID, if you follow the procedure I outline, the UUID will remained the same even during resizing post-installation!
For whatever reason if UUID change because of partitioning, you may need to adjust them so that OS works,, that is lots of work on 10 computers :lol:

Q2. Looks like you configure all partitions as primary partitions. Is there any reason?
No reason, just easy to list that procedure in details and procedure is 'smoother' :mrgreen: :lol:
FYI, When using gparted on a brand new hard drive. I created /dev/sda1 200 M, ext2 for /boot. Gparted assigned it as primary parition. On subsequent partitions, gparted defaults them as logical partitions (primary option unchecked). I have heard of a limit of 4 primary partitions max, but why would gparted default to logical partition right after the very first primary partition?
I am not sure, each time I play with gparted it always default to Primary until limit of 4 is reached.
When you right click a unallocated space, gparted pop-up windows should show you that default. Perhaps you 'accidentally' click that column to "extended"?
Once it becomes extended partition, any additional partition created inside would start from sda5 regardless of how many primary partitions you have.

You can play with a new formatted hard disk to figure that out. . :mrgreen:

User avatar
Eucalyptus
Level 3
Level 3
Posts: 125
Joined: Thu May 14, 2009 9:50 am
Location: Canada

Re: Cloning LM 11 on 10 computers

Post by Eucalyptus » Wed Aug 31, 2011 10:57 pm

Greatly appreciate your help. Wayne. Thanks.

beer-in-box
Level 1
Level 1
Posts: 33
Joined: Thu Sep 22, 2011 8:28 am

Re: Cloning LM 11 on 10 computers

Post by beer-in-box » Sun Oct 02, 2011 6:03 pm

wayne128 wrote: Install from Clone to new comp[/color]
7. now to install on new computer, run Live CD, ensure hard disk is unallocated or just format it. Then add the first partition with SWAP with the size you determined.
gparted will assign SWAP to /dev/sda1, remember I do this to illustrate and putting SWAP first simpify thing.
The rest of the hard disk space remain unallocated.
8. plug in USB drive. run gparted and now you see the Clone2,3,4
9. copy from USB drive Clone2, paste to new comp unallocated space.
gparted will copy the whole partition over and when complete would assign its number to /dev/sda2.
10. copy from USB drive clone3, paste to new comp unallocated space, gparted will copy the whole clone3 and when complete it will assign it to /dev/sda3
11. copy from USB drive clone4, paste to new comp unallocated space, gparted will copu the whole clone4 and when complete it will assign it to /dev/sda4
12. Now the copy and paste complete.
Will this method work if I have another OS on the computer? You said "ensure hard disk is unallocated or just format it". Does that mean that it would take away my other OS?

And does Gparted copy the whole partition? I mean, in Windows, Acronis Backup copies the data when I say "Copy the partition". Assume that I have a 10GB partition and I only used 4 GB of it. So, will GParted create a 10GB clone? Or will it just create a clone of my data which would be less than 10GB (say 4 GB)?

wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: Cloning LM 11 on 10 computers

Post by wayne128 » Sun Oct 02, 2011 6:27 pm

Will this method work if I have another OS on the computer?
Yes, I do this all the time.
You said "ensure hard disk is unallocated or just format it". Does that mean that it would take away my other OS?
This statement is for a new drive.

If the drive has another OS or many OSes, what is required is some unallocated space available that can be used by gparted.

Actually I can copy clone to an 'existing partition' to replace another OS that I no longer wish to keep, as long as this partition is 'larger than' the clone.

And does Gparted copy the whole partition?
Yes

Assume that I have a 10GB partition and I only used 4 GB of it. So, will GParted create a 10GB clone? Or will it just create a clone of my data which would be less than 10GB (say 4 GB)?
When you use gparted to copy 10G partition, it will copy the whole 10G.

That was the reason I mentioned earlier, if partition is something like 200G containing a 4G OS, I would save time by first resizing the OS partition to something like 5-6G, copying 5-6G obviously takes much shorter time than 200G, afterall most of those 200G are blank.

bmike1
Level 5
Level 5
Posts: 612
Joined: Mon Nov 28, 2011 1:13 am

Re: Cloning LM 11 on 10 computers

Post by bmike1 » Wed Dec 28, 2011 11:45 am

if you don;t want to copy white spaces this may interest you: http://www.sysresccd.org/Main_Page
I'm still learning it so I won't be of any more help to you than the help I just gave!
Home brewed computer. Mint18.3 on Quad core AMD Athlon II X4 620 (-MCP-) CPU. GA-MA785G-UD3H board. Advanced Micro Devices [AMD/ATI] RV770 [Radeon HD 4850] X.Org: 1.15.1 video. 500 watt Antec SmartPower 2.0 power supply.

kwisher
Level 5
Level 5
Posts: 781
Joined: Wed Mar 05, 2008 12:54 pm
Location: Greentown, Indiana USA

Re: Cloning LM 11 on 10 computers

Post by kwisher » Wed Dec 28, 2011 2:45 pm

Another option is the OpenSource project FOG (fogproject.org). This would require a separate machine to act as the FOG image server. If you have the need to re-image machines on a regular basis then I highly recommend FOG. You can also setup a CloneZilla imaging server also.
The instructions suggested Windows XP or better, so I installed Linux :)

Post Reply

Return to “Newbie Questions”