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
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,
/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
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.
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.