This depends a bit on your setup, and how exact you need to be about it. One way which will work would be to boot off a USB pen, and then do a backup of the block device (normally, but not always /dev/sda).
There are a few ways to do this. If this is a "one off", The simplest way is:
- In your Linux install, dd if=/dev/zero of=/tmp/del.me (This will
take a LONG time as its creating a large file with zeros). The system
will eventually run out of space and die with an error. THIS IS GOOD !!
- rm /tmp/del.me
- Reboot with Linux based USB system. Plug in your backup disk.
- If your data is on /dev/sdaX, and your backup disk is mounted as /mnt
/backup_disk
execute the command cat /dev/sda | gzip -c /mnt/backup_disk/initial-ubuntu-install.gz to create an image. Once this is eventually done, unmount the backup disk and you have an image called initial-ubuntu-install.gz.
To recover from this backup later on, boot from a USB disk and execute the command zcat /mnt/backup_disk/initial-ubuntu-install.gz > /dev/sda
Steps 1 and 2 above zero out the unused disk to make it more compressable. They are optional, but will probably result in a way smaller compressed backup image.
Step 4 creates a compressed backup image. It is crude and does not give any indications of progress, but it uses standard tools which come with only a regular install. If your USB has pv (or you apt-get install pv) you can replace the command with pv /dev/sda | gzip -c /mnt/backup_disk/initial-ubuntu-install.gz to give you an indication of progress, similarly for decompressing you can use zcat /mnt/backup_disk/initial-ubuntu-install.gz | pv > /dev/sda
There are other, more complex ways of doing this excercise depending on if it needs to include everything, or just most stuff, but these techniques are more advanced.
I will confirm that Linux does have the idea of snapshots using "Logical Volume Management", and its not uncommon (but not required) for the root partition to be installed on a logical volume. IF you have Logical volumes installed you can take snapshots and back those up - BUT THERE IS A CATCH. Ubuntu can't boot off a Logical Volume, so it needs a small additional partition (typically mounted as /boot) to boot. In order to make this work you would need to -
- Take a dump of the disk geometry.
- Back up the /boot partition.
- Create a snapshot and then back it up.
- Destroy the snapshots.
[ Linux snapshots create a temporary copy of the exact state of a partition, they do not create an image for backing up - rather you need to take the snapshot and back it up as you would a partition - the only difference is that you can operate on a live OS, rather then booting to a USB key.
There used to be something that did this called remastersys, and it only worked on ubuntu and debian. Original developer stopped working on it but this seems to be a working fork https://github.com/chamuco/respin. I'll post a better answer once I've gotten around to testing it.
– Journeyman Geek – 2015-10-23T06:34:45.470Very well @JourneymanGeek Thanks for your reply. I'll take a look at it as soon as possible :) – None – 2015-10-24T04:10:27.700
Let me know if it worked for you. I'll post a fuller answer when I get around to setting up a full fat (k)ubuntu system to test. – Journeyman Geek – 2015-10-24T04:11:26.830
All right! I'll inform you about how the quest goes :) – None – 2015-10-24T04:22:50.990
Hello @JourneymanGeek I have not tried any solutions... I don't know if I'll really do it for personal aspects reasons... but if I do I'll try to remember to come back and update you!!! Thanks – None – 2015-12-29T15:26:35.753
Hello @JourneymanGeek for now I won't really do it. Maybe I won't at all. And I don't need to use superuser for now, so... but by all means thanks a lot to you and all!!! – None – 2016-02-02T14:40:52.290