3

We are running a Debian-based system in our product, out of which I need to create new drives from a master drive.

Method 1: Install OS from debian live CD and copy the required custom software.

Earlier, I stared my process with method 1, I various errors like operators missing dependencies, while installing the OS etc and it takes about 80 minutes to install OS and my software. So, I was not able to continue this mechanism.

Method 2: Taking clone of the master drive and place it in a server. Running clonezilla and installing clone.

This method was working out very well for me earlier. Nowadays, customers requires different HDD sizes. A single clone does not work out for me. So this makes me to maintaining multiple clones and it takes about 30 minutes to install the clone.

Method 3: Just partition the drive copy all the OS files from master to slave.

This method gives me the freedom of just copying the files from master to slave. Also, allows me to maintain a single master disk.Also, this method takes about 10 minutes for copying files. But, I feel there might be many CONS using this method.

I want to maintain a single copy of my master and consume less time to create a new slave drive.

2 Answers 2

2

One other option to suggest.

fsarchiver does a good job of restoring file systems to a different size partition or even a different file system type.

You could make a backup of your master

fsarchiver savefs /path2storage/master.fsa /dev/sda1 /dev/sda2 /dev/sda3

The previous example uses three partitions, /boot / and /home.

Partition new disk to size and restore master.fsa

fsarchiver restfs /path2storage/master.fsa id=0,dest=/dev/sdb1 id=1,dest=/dev/sdb2 id=2,dest=/dev/sdb3

Obviously you need to substitute the appropriate devices

After restoring an fsarchive one would need to update the target /etc/fstab and install a bootloader from chroot.

fsarchiver -h shows examples of converting filesystem type

2
  • does fsarchiver support online-replication or do the filesystems need to be unmounted?
    – Bratchley
    Apr 1, 2014 at 18:12
  • 1
    technically it does with the -A switch, however I wouldn't use that option unless you have no other choice. For something as important as your "master", it should be as clean as possible. I would suggest using a live cd, something like sysrescuecd, which has fsarchiver pre-installed.
    – bsd
    Apr 1, 2014 at 18:43
1

It's easy to adapt method 2 to different hard disk sizes.

Option 1: make the master as small as possible (say shrink it to 90% full). Use Clonezilla to clone it, then parted or lvextend followed by resize2fs to enlarge the filesystem.

Option 2: make the master a system volume which has ample space for the OS and base software plus anticipated extra packages and upgrades. Use the remaining space on the disk for a volume for user data mounted on /srv.

2
  • Could you please help me in listing possible CONS of method 3.
    – Ragav
    Mar 28, 2014 at 3:03
  • @Ragav Requires more work that you didn't list (at a minimum: set up the partitions, install the bootloader). Also, it's slower to copy files individually. Tha's why I don't advise it. Mar 28, 2014 at 3:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .