0% found this document useful (0 votes)
77 views20 pages

How To Disk Clone Clonezilla Samba

This document describes how to use Clonezilla and a Samba share to create a customized operating system image and restore it on multiple PCs. It explains how to set up a Samba share to store disk/partition images, install and configure Clonezilla, create an image of a disk or partitions and save it to the Samba share, and how to restore a disk or partitions from an image stored on the share. The process allows quickly preparing multiple PCs for a lab environment by cloning a single customized operating system configuration.

Uploaded by

swt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views20 pages

How To Disk Clone Clonezilla Samba

This document describes how to use Clonezilla and a Samba share to create a customized operating system image and restore it on multiple PCs. It explains how to set up a Samba share to store disk/partition images, install and configure Clonezilla, create an image of a disk or partitions and save it to the Samba share, and how to restore a disk or partitions from an image stored on the share. The process allows quickly preparing multiple PCs for a lab environment by cloning a single customized operating system configuration.

Uploaded by

swt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 20

How to copy customized operating system image

on Multiple PCs using Clonezilla and Samba


share as images repository

Purpose of this document is to describe how to quickly prepare PC for Lab environment. There is an
excellent software which enable a single drive or even a single partition cloning, so we can use to
recover broken OS, hard drive, etc. Clonezilla is a freeware, so we don't need to purchase expensive
licenses. Clonezilla has GUI which make our work very simple. This document describes how to use
Clonezilla with Samba shares for storing drives/partitions images (as an image repository). To create
this howto I used Virtualbox machine to capture screenshots, but the process of creating images and
restoring is the same.

1.Samba shares preparation :

First of all you should create images repository on one PC (I've used AWT-DEBUG-SGW PC)
Clonezilla support various storage options:Local Device, SSH server, Samba server, NFS Server, but I
think the best choice for us is samba share, as it is simple to configure.

1.1. Samba installation and configuraiton

We need to make sure we have samba os installed.

:~ # yast2

1of 20 How to disk clone - Marcin Świtilnik


and required services are started on boot, so go to System>System Services (Runlevel) tab

2of 20 How to disk clone - Marcin Świtilnik


make sure that two services are started on boot: nmb and smb.

Next step is to create shares:

You need to create mount point and give required permissions:


:~ # mkdir -p /mnt/smb_shares/Images
:~ # chmod 0744 -R /mnt/smb_shares/

Second step is to edit configuration file /etc/samba/smb.conf, it should look like as follows:

3of 20 How to disk clone - Marcin Świtilnik


# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2011-07-28
[global]
workgroup = WORKGROUP
#workgroup = AWT
netbios name = AWT-REPOSITORY
server string = AWT Samba server
security = user
quest = ok
load printers = no
printing = bsd
printcap name = /dev/null
encrypt passwords = yes
smb passwd file = /etc/smbpass
log file = /var/log/samba-log.%m
log level = 3
max log size = 2048

#wins support = yes #if we want to smb server acts as WINS server.
#name resolve order = lmhosts host wins bcast
local master = yes
preferred master = yes
os level = 65

[Shares]
comment = Temporary files
path = /mnt/smb_shares
create mask = 0776
directory mask = 0774
browsable = yes
writable = yes
guest ok = no
valid users = emssim

Now we need to create user and set samba password, it should be done as follows:

:~ # useradd -G users emssim


:~ # smbpasswd -a emssim

then we need to restart service

:~ # /etc/init.d/smb restart

4of 20 How to disk clone - Marcin Świtilnik


If you want to check if all works as expected then please type following command:

:~ # testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Unknown parameter encountered: "quest"
Ignoring unknown parameter "quest"
Processing section "[Shares]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
netbios name = AWT-REPOSITORY
server string = AWT Samba server
smb passwd file = /etc/smbpass
log level = 3
log file = /var/log/samba-log.%m
max log size = 2048
load printers = No
printcap name = /dev/null
os level = 65
preferred master = Yes
printing = bsd
print command = lpr -r -P'%p' %s
lpq command = lpq -P'%p'
lprm command = lprm -P'%p' %j

[Shares]
comment = Temporary files
path = /mnt/smb_shares
valid users = emssim, awt
read only = No
create mask = 0776
directory mask = 0774

You can test it by mounting in Linux or Windows PC, then please create Image directory.

2. Clonezilla preparation.

2.1 Getting and creating installation media


You need to download Clonezilla iso image and burn it on CD/DVD or create bootable pendrive, if
you would like to prepare bootable prendrive I suggest you to use unetbootin is a freeware and easy to
use.

You can download Clonezilla here: http://clonezilla.org/downloads.php . Make sure you downloaded
stable version of this tool. If you want to use Unetbootin as I suggested please visit
http://unetbootin.sourceforge.net/ site and download stable release. Once you have downloaded file(s)
you are ready to go.

5of 20 How to disk clone - Marcin Świtilnik


3. Creating image

3.1 Booting from Clonezilla live CD

You have to boot form the Clonezilla media which you have prepared already (live CD/DVD or
bootable pendrive). First screen will prompt you to select settings, so choose one and press Enter. Then
The debian boot sequence will appear.

3.2 Choose the language from the language screen.

You could stay with default choose.

6of 20 How to disk clone - Marcin Świtilnik


3.3 Choose your keyboard layout.

3.4 Start Clonezilla.

Don't drop into a console unless you are Clonezilla expert.

7of 20 How to disk clone - Marcin Świtilnik


3.5 Choose your device image.

You can choose between creating image or doing a direct device-to-device copy. In our case you should
choose create device-image.

3.6 Select the repository that will hold your image.

You need to tell Clonezilla where image will be saved. Chose samba_server option as we want to store
our images on this repository.

8of 20 How to disk clone - Marcin Świtilnik


3.7 Choose network configurations

Use dhcp as our standard configuration.

3.8 Enter the IP address of samba server and domain name

In our case the IP address is 10.83.205.225, you should leave domain name blank.

9of 20 How to disk clone - Marcin Świtilnik


3.9 Enter username and password to access samba share - in this case it is /images directory

you will be prompted to confirm, if all looks ok then please press Enter.

10of 20 How to disk clone - Marcin Świtilnik


3.10 Choose the mode of operation

Next you will be asked to choose mode of operation, please leave it default

3.11 Saving options

You can save all disk as an image or just particular partition(s).

11of 20 How to disk clone - Marcin Świtilnik


3.12 Enter image name.

3.13 Choose the source disk.

12of 20 How to disk clone - Marcin Świtilnik


3.14 Additional options.

13of 20 How to disk clone - Marcin Świtilnik


3.15 Confirm start of the saving process.

14of 20 How to disk clone - Marcin Świtilnik


3.16 Checking created images and finishing saving process.

Once saving process is finished then Clonezilla check if image is restorable.

3.17 Reboot to finish.

When the image is ready, Clonezilla prompt you to reboot PC.

15of 20 How to disk clone - Marcin Świtilnik


4 Restoring drive form image

4.1 Booting from Clonezilla live CD .

You have to boot form the Clonezilla media which you have prepared already (live CD/DVD or
bootable pendrive). First screen will prompt you to select settings, so choose one and press Enter. Then
The debian boot sequence will appear.

In the first phase the restoring process is very similar to Creating image process, follow the same steps
up to 3.11 point. Then you should see more options.

4.2 Please choose restoredisk option.

16of 20 How to disk clone - Marcin Świtilnik


4.3 Choose image file you would like to restore.

4.4 Choose the destination disc or partitions.

17of 20 How to disk clone - Marcin Świtilnik


4.5 Confirm.

Press Enter, then you will be asked if you are sure and want to proceed (twice), type “y” twice then
restoration process stats.

18of 20 How to disk clone - Marcin Świtilnik


4.6 Reboot PC

When the restoration process is finished you will be promtped to press Enter and reboot.

That's all.

19of 20 How to disk clone - Marcin Świtilnik


Tip:

If you restored couple partitions, not full hard drive please make sure that correct partition has bootable
flag configured, if not PC will failed to boot with an error message.

20of 20 How to disk clone - Marcin Świtilnik

You might also like