Discussion:
[Clonezilla-live] Create an image of the disk without rebooting the server
G. Massera
2008-07-09 09:31:17 UTC
Permalink
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)

I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.

There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???


Thank you,
Gianluca
Steven Shiau
2008-07-09 09:40:11 UTC
Permalink
Hi,
Clonezilla is an image tool, which means it _images_ the used blocks of
file system in a partition, not to mount the file system and save each
files. Therefore, the answer is no.
Although maybe it's possible you can try to force to save the mounted
partition, the saved image might be corrupted.

In the future, we might add file-based backup and restore... Who knows...

Steven.
Post by G. Massera
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)
I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.
There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???
Thank you,
Gianluca
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Clonezilla-live mailing list
https://lists.sourceforge.net/lists/listinfo/clonezilla-live
G. Massera
2008-07-09 09:45:45 UTC
Permalink
Hello,
So, the problem is that creating an image of a mounted disk can create a
corrupted image because in the meanwhile the used blocks changes...
right ?!?! I get it correctly ???

If I understand correctly, it's possible to create a script that
automatically reboot the system, save the image, and reboot the server
in batch without the user intervention ... so, I can create periodically
backups of my server ???

Thank you,
Gianluca
Post by Steven Shiau
Hi,
Clonezilla is an image tool, which means it _images_ the used blocks
of file system in a partition, not to mount the file system and save
each files. Therefore, the answer is no.
Although maybe it's possible you can try to force to save the mounted
partition, the saved image might be corrupted.
In the future, we might add file-based backup and restore... Who knows...
Steven.
Post by G. Massera
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)
I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.
There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???
Thank you,
Gianluca
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Clonezilla-live mailing list
https://lists.sourceforge.net/lists/listinfo/clonezilla-live
G. Massera
2008-07-09 10:03:41 UTC
Permalink
Hello,
So, the problem is that creating an image of a mounted disk can create a
corrupted image because in the meanwhile the used blocks changes...
right ?!?! I get it correctly ???

If I understand correctly, it's possible to create a script that
automatically reboot the system, save the image, and reboot the server
in batch without the user intervention ... so, I can create periodically
backups of my server ???

Thank you,
Gianluca
Post by Steven Shiau
Hi,
Clonezilla is an image tool, which means it _images_ the used blocks
of file system in a partition, not to mount the file system and save
each files. Therefore, the answer is no.
Although maybe it's possible you can try to force to save the mounted
partition, the saved image might be corrupted.
In the future, we might add file-based backup and restore... Who knows...
Steven.
Post by G. Massera
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)
I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.
There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???
Thank you,
Gianluca
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Clonezilla-live mailing list
https://lists.sourceforge.net/lists/listinfo/clonezilla-live
Steven Shiau
2008-07-09 10:52:43 UTC
Permalink
Hi Gianluca,
Post by G. Massera
Hello,
So, the problem is that creating an image of a mounted disk can create a
corrupted image because in the meanwhile the used blocks changes...
right ?!?! I get it correctly ???
Yes.
Post by G. Massera
If I understand correctly, it's possible to create a script that
automatically reboot the system, save the image, and reboot the server
in batch without the user intervention ... so, I can create periodically
backups of my server ???
Yes, it is possible.
1. Install the Clonezilla live in one of the partitions. Ref:
http://drbl.sourceforge.net/faq/index.php#path=./2_System&entry=45_clonezilla_in_harddrive.faq
2. In your running OS, change the grub config file to let it default to
boot from Clonezilla live, then reboot
3. Use the batch mode of Clonezilla live to save the image.
4. After the clone is done, change the grub config again to let it boot
from existing OS. Reboot.

This is just an idea. I did not test it, but it should work.

Regards
Steven.
Post by G. Massera
Thank you,
Gianluca
Post by Steven Shiau
Hi,
Clonezilla is an image tool, which means it _images_ the used blocks
of file system in a partition, not to mount the file system and save
each files. Therefore, the answer is no.
Although maybe it's possible you can try to force to save the mounted
partition, the saved image might be corrupted.
In the future, we might add file-based backup and restore... Who knows...
Steven.
Post by G. Massera
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)
I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.
There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???
Thank you,
Gianluca
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Clonezilla-live mailing list
https://lists.sourceforge.net/lists/listinfo/clonezilla-live
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Clonezilla-live mailing list
https://lists.sourceforge.net/lists/listinfo/clonezilla-live
Les Mikesell
2008-07-11 17:06:06 UTC
Permalink
Post by Steven Shiau
Hi,
Clonezilla is an image tool, which means it _images_ the used blocks of
file system in a partition, not to mount the file system and save each
files. Therefore, the answer is no.
Although maybe it's possible you can try to force to save the mounted
partition, the saved image might be corrupted.
In the future, we might add file-based backup and restore... Who knows...
I'd really appreciate having this. It might require some tool to save
the existing partition/filesystem/bootblock for reconstruction - and a
way to create/edit it if you don't have it or want to make changes.

It would be really nice if this could be integrated with backuppc
(http://backuppc.sourceforge.net/) which does a great job of everything
except bare metal restores. It can, however, deliver a tar image with
the recent full/incremental runs already merged using a command line
tool which can be executed via ssh. It would just take a few more
scripted steps than clonezilla already does to deal with the grunge work
of building the partitions, making filesystems, then mounting them
somewhere and extracting the tar contents. It's not impossible to do
this manually, but there are a lot of steps to it.
--
Les Mikesell
***@gmail.com
Bill Gurley
2008-07-09 13:26:49 UTC
Permalink
Post by G. Massera
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)
I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.
There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???
I love clonezilla! And I use it almost every day.

But, long before clonezilla, I was using a different open source tool
for situations like you describe, and that is Mondo Rescue:

http://www.mondorescue.org/

It will backup a live filesystem, and will create iso files that can be
used to create bootable restore CD's. I've been using this for years on
my servers that stay up all the time. It uses a curses menu system
(similar to clonezilla), but also supports command line capability. I
have a script in a weekly cron that backs up the running system, but
excludes the user space, which is backed up nightly using rsync.

I use external usb disks, which I rotate, so the iso's are stored there.

Here is an example script in cron.weekly:

#!/bin/sh
#
# This is a script to run the "Mondo Rescue" program in archive mode
# to backup the system, with certain excludes. This will create
# ISO images which can be used to restore the system.
#
#
# 'man mondoarchive' shows all of the switch options.
#
#
# First, let's test to see if the USB drive is mounted,
# then proceed.
if (mount|egrep '/mnt/usbdisk' > /dev/null)
then
echo 'USB disk is mounted; Running the Mondo backup...'
# Delete the old iso files...
rm -f /mnt/usbdisk/Mondo/Atom*
sleep 2
mondoarchive -Oi -d /mnt/usbdisk/Mondo -E "/mnt/usbdisk" -p Atom -9 -s
660m -F
else
echo The USB disk IS NOT mounted.
fi


So far, I have not had a catastrophe where I have needed to use these
ISO's! But I have done test restores. It can get messy, if your
situation has any complications, such as LVM. But if you take the time
to learn about Mondo, this can be a very useful tool, as is clonezilla
as well.


-Bill-

---------------------------------
Bill Gurley, Technical Director
Department of Chemistry
Univ. of Tennessee, Knoxville
865-974-3145
Steven Shiau
2008-07-10 02:09:44 UTC
Permalink
Bill,
Thanks for the information. Yes, Mondo Rescue is better than Clonezilla
for this case.

Regards,
Steven.
Post by Bill Gurley
Post by G. Massera
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)
I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.
There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???
I love clonezilla! And I use it almost every day.
But, long before clonezilla, I was using a different open source tool
http://www.mondorescue.org/
It will backup a live filesystem, and will create iso files that can be
used to create bootable restore CD's. I've been using this for years on
my servers that stay up all the time. It uses a curses menu system
(similar to clonezilla), but also supports command line capability. I
have a script in a weekly cron that backs up the running system, but
excludes the user space, which is backed up nightly using rsync.
I use external usb disks, which I rotate, so the iso's are stored there.
#!/bin/sh
#
# This is a script to run the "Mondo Rescue" program in archive mode
# to backup the system, with certain excludes. This will create
# ISO images which can be used to restore the system.
#
#
# 'man mondoarchive' shows all of the switch options.
#
#
# First, let's test to see if the USB drive is mounted,
# then proceed.
if (mount|egrep '/mnt/usbdisk' > /dev/null)
then
echo 'USB disk is mounted; Running the Mondo backup...'
# Delete the old iso files...
rm -f /mnt/usbdisk/Mondo/Atom*
sleep 2
mondoarchive -Oi -d /mnt/usbdisk/Mondo -E "/mnt/usbdisk" -p Atom -9 -s
660m -F
else
echo The USB disk IS NOT mounted.
fi
So far, I have not had a catastrophe where I have needed to use these
ISO's! But I have done test restores. It can get messy, if your
situation has any complications, such as LVM. But if you take the time
to learn about Mondo, this can be a very useful tool, as is clonezilla
as well.
-Bill-
---------------------------------
Bill Gurley, Technical Director
Department of Chemistry
Univ. of Tennessee, Knoxville
865-974-3145
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Clonezilla-live mailing list
https://lists.sourceforge.net/lists/listinfo/clonezilla-live
G. Massera
2008-07-10 08:32:33 UTC
Permalink
Hello Bill,
I know mondo... but is not for me... because, it lacks a features.
It cannot write/restore data via SSHFS... it only support NFS.
Running Mondo on my server will produce 50 CDs !!!
So, in case of restore after a disaster... I would burn 50 CD !!!
For this, mondo support the storage and restoration over NFS, so, you
don't need to burn 50 CD... but I cannot have NFS access... but SSHFS
access.
This is because I use clonezilla... that support saving/restore via
sshfs connections.

Ciao,
Gianluca
Post by G. Massera
Hello everybody,
first of all,
Thank you for Clonezilla... it's a fantastic system for cloning machines :-)
I need to create images of a server hard-disk... but I cannot restart
and boot the clonezilla-live for create the image.
So, It would be fantastic if there is a way to run a command (script)
that create the image without rebooting the server machine.
There is a way to extract the command from clonezilla-live CD and
install into my Linux Server and run it with a crontab ???
I love clonezilla! And I use it almost every day.
But, long before clonezilla, I was using a different open source tool
http://www.mondorescue.org/
It will backup a live filesystem, and will create iso files that can
be used to create bootable restore CD's. I've been using this for
years on my servers that stay up all the time. It uses a curses menu
system (similar to clonezilla), but also supports command line
capability. I have a script in a weekly cron that backs up the running
system, but excludes the user space, which is backed up nightly using
rsync.
I use external usb disks, which I rotate, so the iso's are stored there.
#!/bin/sh
#
# This is a script to run the "Mondo Rescue" program in archive mode
# to backup the system, with certain excludes. This will create
# ISO images which can be used to restore the system.
#
#
# 'man mondoarchive' shows all of the switch options.
#
#
# First, let's test to see if the USB drive is mounted,
# then proceed.
if (mount|egrep '/mnt/usbdisk' > /dev/null)
then
echo 'USB disk is mounted; Running the Mondo backup...'
# Delete the old iso files...
rm -f /mnt/usbdisk/Mondo/Atom*
sleep 2
mondoarchive -Oi -d /mnt/usbdisk/Mondo -E "/mnt/usbdisk" -p Atom -9 -s
660m -F
else
echo The USB disk IS NOT mounted.
fi
So far, I have not had a catastrophe where I have needed to use these
ISO's! But I have done test restores. It can get messy, if your
situation has any complications, such as LVM. But if you take the time
to learn about Mondo, this can be a very useful tool, as is clonezilla
as well.
-Bill-
---------------------------------
Bill Gurley, Technical Director
Department of Chemistry
Univ. of Tennessee, Knoxville
865-974-3145
Kristian Erik Hermansen
2008-07-10 19:24:55 UTC
Permalink
Post by Steven Shiau
Bill,
Thanks for the information. Yes, Mondo Rescue is better than Clonezilla
for this case.
There is a possible trick that you might be able to utilize. I have
not tried it, but I think it may work :-) VMware Workstation allows
you to specify a vritual machine that points to a a RAW DISK for the
"virtual disk". In this case, you would point it at your server's
internal drive or drives. Once you do that, go through with
specifying the guest type as Linux, etc, and then use PXE boot. Have
clonezilla copy the entire disk or disks you want to clone. Bam. You
just cloned a live machine :-P There are some possible downsides or
reasons this may or may not work as I have *NOT* tried it, but I
encourage you to!

* VMware is closed source. Perhaps VirtualBox or KVM has a similar
RAW DISK mode feature.
* The host hard disk and partition might be in flux, and thus without
proper file locking, your cloned image could be
invalid/corrupted/incorrect. It may be possible to clone the image
and then use a fsck utility to clean up the journal or other errors as
a result, but I would test this first.

Even though this is a silly hack suggestion, it just might work for
you. Cloning a live machine via Clonezilla would be quite an amazing
feat so let us know if you are able to do so. Regards...
--
Kristian Erik Hermansen
--
CISSP, CEPT, CREA, CEH, Linux+, A+, QGCS, ACSA, this is getting ridiculous...
http://kristian-hermansen.com
G. Massera
2008-07-11 13:15:19 UTC
Permalink
Post by Kristian Erik Hermansen
Post by Steven Shiau
Bill,
Thanks for the information. Yes, Mondo Rescue is better than Clonezilla
for this case.
Even though this is a silly hack suggestion, it just might work for
you. Cloning a live machine via Clonezilla would be quite an amazing
feat so let us know if you are able to do so. Regards...
Hello,
yes... I will try to clone a live machine... I looking for a way to
prevent writing on disk for a while... the time necessary to take an
image of the disk.
Somebody knows a way to enable a kind of write-protection on a linux
partition for a certain amount of time ???
Another way, could be to use the initrd and run the command for take the
image of the disk before the mount command... but at that time, the
network is not active... right ?!?!?

Ciao,
Gianluca
Kristian Erik Hermansen
2008-07-11 20:04:35 UTC
Permalink
Post by G. Massera
Hello,
yes... I will try to clone a live machine... I looking for a way to
prevent writing on disk for a while... the time necessary to take an
image of the disk.
Somebody knows a way to enable a kind of write-protection on a linux
partition for a certain amount of time ???
Another way, could be to use the initrd and run the command for take the
image of the disk before the mount command... but at that time, the
network is not active... right ?!?!?
Wouldn't merely a mount -o remount ro of the appropriate partitions
work? Then it's read-only until you finish cloning the disk, but the
system is still live :-) Good luck...
--
Kristian Erik Hermansen
--
CISSP, CEPT, CREA, CEH, Linux+, A+, QGCS, ACSA, this is getting ridiculous...
http://kristian-hermansen.com
G. Massera
2008-07-14 08:06:46 UTC
Permalink
Post by Kristian Erik Hermansen
Post by G. Massera
Hello,
yes... I will try to clone a live machine... I looking for a way to
prevent writing on disk for a while... the time necessary to take an
image of the disk.
Somebody knows a way to enable a kind of write-protection on a linux
partition for a certain amount of time ???
Another way, could be to use the initrd and run the command for take the
image of the disk before the mount command... but at that time, the
network is not active... right ?!?!?
Wouldn't merely a mount -o remount ro of the appropriate partitions
work? Then it's read-only until you finish cloning the disk, but the
system is still live :-) Good luck...
Yeaahhh... I will try !! :-) Thank you.
Just a final question... How can I extract the program and the
command-line used for take the image of a partition ???
I need only the command for the image, because I need just to update the
image of partion and not the partition-table and GRUB.

Thank you,
Gianluca

Loading...