Does anyone know how to run dd to backup for Clonezilla live?

Greetings after so many mishaps with my server of my own fault I want to know is their actually a way that i can clone a hard drive in a live environment. And force it to ssh out to another server… Maybe DD commands or some things… What i was thinking is I could setup a shell script to run this every week allowing my server to be backed up live…

Any thoughts?

I use Clonezilla, but not live so I can’t help you there.
Regardless, my 2c;
The backup module works, for a given server I point mine at another share on another node, if you junk your server, you install fresh, install the backup module, point it to the backup node and restore.

1 Like

how does the backup module work with my customized file locations and website.conf files…

I guess what i am asking is what all does it backup?

Does it get my mysql files?

That’s up to you, it covers everything involved in a stock install, but you can add your custom locations.

http://docs.nethserver.org/projects/nethserver-devel/en/latest/backup.html

What i might do tonight is once i get every thing as close as I like it create an clonezilla image backing it up to my other server… But thats not exactly a permanent solution… I figured maybe you could dd and copy like that live…

This command has not yet been tested but is this possible??

dd if=/dev/sda | gzip -1 - | ssh user@192.168.1.10 dd of=image.gz

Would clonezilla be able to read this image and put it back up?

Maybe this might be a better backup idea for a live clone not sure…

#warning this has not been completely tested…
sudo dd if=/dev/sda |ssh user@192.168.1.10 of=/home/loren/Desktop/backup/imgbackups/latest/nethserver.img

df -h reveals some thing i was not expecting…

So what exactly should be backed up?? will just /dev/sda work or will it require me to back up everything individually…

This dosen’t make since why would things be stored all in one directory?

[root@webserver ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      290G   33G  243G  12% /
tmpfs                 4.9G     0  4.9G   0% /dev/shm
/dev/sda1             504M   66M  413M  14% /boot
[root@webserver ~]#

sfdisk -l -uM shows…

[root@webserver ~]# sfdisk -l -uM

Disk /dev/sda: 39162 cylinders, 255 heads, 63 sectors/track
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sda1   *     1    512    512     524288   83  Linux
/dev/sda2       513  307199  306687  314047488   8e  Linux LVM
/dev/sda3         0      -      0          0    0  Empty
/dev/sda4         0      -      0          0    0  Empty

Disk /dev/mapper/VolGroup-lv_swap: 636 cylinders, 255 heads, 63 sectors/track

Disk /dev/mapper/VolGroup-lv_root: 38456 cylinders, 255 heads, 63 sectors/track
[root@webserver ~]# 

so in theory would /dev/sda just copy all drives??

I’m confused, when you say live, I assume you mean with the server running, so are you trying to run dd while the server is running or are you booting the server with a clonezilla live cd?

When i mean live I mean that I am running the server live not clonezilla live cd…
The goal is to revert back to a clonezilla cd and just grab the image and slam it on the server if needed…

Really the goal would be to run the dd command at least once a day to backup the important data…

You realize there’s no such thing as in instantaneous snapshot of a hd?
How will you reconcile changes that occur during the time that passes while you’re reading through the file system?

Understand, dd will basically start at the beginning of the disk and read toward the end of the disk, the os will write wherever the hell it feels like it, too bad if it’s somewhere that dd has already read.

I would figure that during that time no traffic other than basic web and minecraft along with some teamspeak traffic would be occuring but for the most part that is all stored in their proper folders…

As far as server side configuration it should get things close…

so far the biggest issue during an installation of Nethserver is getting the system to understand what ip it is and the proper gateway…

Getting the system some what copied over would be a good thing and save about 14 hrs of work…

Before we released 6.8, I installed a server, setup several modules, (backup, ips, users, samba, owncloud, mail), loaded a bunch of files, let the backup run, destroyed the server, installed it again, got it on the lan, installed backup, pointed it to the share where the backups were, hit restore and off the top of my head, that was probably 90-120 minutes.
The reinstall and restore, probably about 45.
You cannot have confidence in your restore if your try to backup a live server, I would never do that in production, I’m not saying it can’t be done, but rsync and tar at least work with the operating system.

1 Like

I guess i forgot about rsync Good thought i should look into that…

As far as backups… Yea i imagine tonight i will shut the thing done run clonezila live to back it up… Its kinda one of those things where we have to run a ton of specialized commands to get it to talk to the network and being that i am not actually sitting next to the server and its located in a datacenter up in Canada makes it a little more challenging to initialize the original startup web page… I have managed quite well with a vm of xubuntu but still not exactly ideal…

In short I really wish that the backup modules allowed for the use of a secondary hard disk to back files up to this way during re-installation i could just pull from the backup hard drive…

Not really a big fan of file share per say ie samba… but really like sftp if possible…

On a another note do you have any recommendations to pull all the sql files down to a folder ? my thought was i could write up a shell script to copy them over as well to the backup drive folder…

Just another way of thinking, because I love virtualization :slight_smile:
What about two instances of Nethserver?
One is only hosting KVM. In the KVM your Nethserver is running. I don’t know KVM but Hyper-V and VMware have the possibility to do snapshots and this snapshots can be backuped. This would be a “live”-Backup like you want it.

Thats kinda what i was thinking I Might clone this drive and create another server instant on a separate ip… will still need to copy files but I think this might actually be a better option…

I will have to see what is needed to do this might take me a day or two…

I tried using the snapshot feature in VMware and I can’t find the snapshot…

What do you mean with “I can’t find”?
Is the snapshot not available in the VMware Client or do you mean in the file structure?

1 Like

I was looking for the file structure… I made a snapshot last night but can’t seem to locate its location…