Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati
  • Differenze per "AmministrazioneSistema/BackupDelSistema/BackupConTar"
Differenze tra le versioni 1 e 16 (in 15 versioni)
Versione 1 del 23/11/2005 19.46.24
Dimensione: 9320
Commento: Importato il documento originale
Versione 16 del 11/02/2007 03.05.00
Dimensione: 9887
Commento: da revisionare
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 1: Linea 1:
'''Note: This page needs work. Use at your own risk. It is recommended that you read the whole page before doing anything''' ## page was renamed from BackupConTar
[[BR]]
[[BR]]
||<tablestyle="font-size: 18px; text-align: center; width:100%; background:red; margin: 0 0 0 0;" style="padding:0.5em;">[[Immagine(Icone/Piccole/warning.png,50,left)]]'''ATTENZIONE: Questo documento richiede una revisione. Usatelo a vostro rischio. Si raccomanda di leggere l'intera guida prima di effettuare alcuna operazione. Per una guida più aggiornata consultare la pagina BackupDelSistemaConSbackup'''||
[[BR]]
Linea 3: Linea 7:
This guide to backup your system using tar to create compressed archives was taken from the post on the Ubuntu Forum written by Heliode. See the thread for discussion: http://www.ubuntuforums.org/showthread.php?t=35087
Linea 5: Linea 8:
[[TableOfContents]] ||<tablestyle="fixed; font-size: 0.9em; width:50%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;">'''Indice'''[[BR]][[TableOfContents]]||
Linea 7: Linea 10:
== Introduction ==
Linea 9: Linea 11:
Hi, and welcome to the Heliode guide to successful backing-up and restoring of a Linux system!
Linea 11: Linea 12:
Most of you have probably used Windows before you started using Ubuntu. During that time you might have needed to backup and restore your system. For Windows you would need proprietary software for which you would have to reboot your machine and boot into a special environment in which you could perform the backing-up/restoring (programs like Norton Ghost).
During that time you might have wondered why it wasn't possible to just add the whole c:\ to a big zip-file. This is impossible because in Windows, there are lots of files you can't copy or overwrite while they are being used, and therefore you needed specialized software to handle this.
[[BR]]Questa guida al backup del sistema con tar è tratta da un post scritto da Heliode sul Forum Ubuntu. Questo è il thread originale della discussione: [http://www.ubuntuforums.org/showthread.php?t=35087]
Linea 14: Linea 14:
Well, I'm here to tell you that those things, just like rebooting, are Windows Crazy Things (tm). There's no need to use programs like Ghost to create backups of your Ubuntu system (or any Linux system, for that matter). In fact; using Ghost might be a very bad idea if you are using anything but ext2. Ext3, the default Ubuntu partition, is seen by Ghost as a damaged ext2 partition and does a very good job at screwing up your data. = Introduzione =
Linea 16: Linea 16:
== Backing-up == Molti di voi probabilmente usavano Windows prima di iniziare ad usare Ubuntu. Prima o poi avrete avuto la necessità di fare il backup e ripristinare il sistema. In Windows queste operazioni richiedono software proprietario per il quale avrete dovuto riavviare il sistema e fare il boot in una sessione speciale in cui eseguire il back-up o il ripristino (questo avviene con programmi come '''Norton Ghost''').
Linea 18: Linea 18:
"What should I use to backup my system then?" might you ask. Easy; the same thing you use to backup/compress everything else; TAR. Unlike Windows, Linux doesn't restrict root access to anything, so you can just throw every single file on a partition in a TAR file! Sicuramente vi sarete chiesti per quale motivo non fosse possibile semplicemente salvare l'intera unità `C:\` in un archivio `*.zip`. Quest'operazione è impossibile perchè in Windows ci sono molti files che non possono essere copiati o sovrascritti mentre sono in uso dal sistema, per questo motivo è necessario un software specifico per eseguire questa operazione.
Linea 20: Linea 20:
To do this, become root with È evidente che questa caratteristica di Windows, come il continuo reboot, è una follia. In Ubuntu non vi è alcuna necessità di usare programmi come Ghost per creare un back-up dell'intero sistema (questo avviene su ogni sistema Linux, peraltro). Del resto utilizzare Ghost su sistemi con filesystem diverso da '''ext2''' sarebbe una pessima idea. '''ext3''', il filesystem standard delle partizioni Ubuntu, è considerato da Ghost come un formato '''ext2''' difettoso e ciò può causare dei danni seri ai dati salvati su di esso.
Linea 22: Linea 22:
= Il Back-up =

Allora vi chiederete "Come faccio a fare il backup del sistema ?". La risposta è semplice: con gli stessi strumenti che utilizzi per archiviare o comprimere ogni altro file: '''tar'''. A differenza di Windows, Linux non restringe l'accesso di root per alcuni file, perciò (con i permessi necessari) puoi salvare ogni file presente nella partizione in un file `*.tar`.
Per fare questo, è sufficiente divenire '''root''' attraverso il comando:
Linea 26: Linea 30:
and go to the root of your filesystem (we use this in our example, but you can go anywhere you want your backup to end up, including remote or removable drives.)
e andare alla directory root del sistema (`/`); il metodo descritto può essere applicato a qualunque directory o partizione, comprese quelle remote o installate su unità rimovibili.
Per spostarsi nella directory root digitate:
Linea 32: Linea 36:
Now, below is the full command I would use to make a backup of my system:
Questo è il comando da utilizzare per fare il back-up del sistema:
Linea 38: Linea 41:
Now, lets explain this a little bit:
 * 'tar' is the program used to do a backup
 * c - create a new backup archive
 * v - verbose mode, tar will print what it's doing to the screen
 * p - preserve permissions, keeps all file permissions the same
 * z - compress the backup file with 'gzip' to make it smaller
 * f <filename> - specifies where to store the backup, /backup.tgz is the file used in this example
 * Now come the directories we want to exclude. We don't want to backup everything since some dirs aren't very useful to include. Also make sure you don't include the file itself, or else you'll get weird results. You might also not want to include the /mnt folder if you have other partitions mounted there or you'll end up backing those up too. Also make sure you don't have anything mounted in /media (i.e. don't have any cd's or removable media mounted). Either that or exclude /media.
 * After all of the options is the directory we want to backup. Since we want to backup everything we use / for the root directory
Vediamo ora di spiegare questa sintassi:
Linea 48: Linea 43:
If you want to exclude all other filesystems you can use the 'l' option instead of --exclude. The above command would thus be:  * `tar`: è il programma necessario a fare il back-up
 * `c`: crea un nuovo archivio di backup
 * `v`: modalità ''verbose'', tar restituisce sullo schermo una descrizione delle operazioni in corso
 * `p`: mantieni permessi, mantiene intatti i permessi di tutti i files
 * `z`: comprime il file di back-up con `gzip` per renderlo più piccolo
 * `f <nomefile>`: specifica dove salvare il backup, `/backup.tgz` è il file utilizzato in questo esempio
 * Qui si mettono tutte le directory che si vogliono escludere dal back-up. Non è necessario fare il back-up di tutto quanto, alcune directory non sono indispensabili. Assicuratevi di non includere anche il file di back-up stesso, altrimenti avrete strani risultati. È meglio anche non includere la cartella `/mnt`, se avete altre partizioni montate lì finirete col fare il back-up anche di quelle. Assiucuratevi anche di non avere niente montato all'interno della cartella `/media` (ad esempio CD, CD-RW), oppure potete escludere anche la cartella `/media`.
 * Dopo tutte le opzioni c'è le directory di cui vogliamo fare il back-up. Utilizziamo `/` dato che vogliamo salvare quasi tutto.
Linea 50: Linea 52:
Se volete escludere tutti gli altri filesystems, potete usare l'opzione `l` al posto di `--exclude`. Il comando precedente risulterebbe:
Linea 54: Linea 57:
EDIT: kvidell suggests on the forum thread that we also exclude the /dev directory. I have other evidence that says it is very unwise to do so though. Se il comando è stato scritto giusto, premete `Invio` e rilassatevi, tutto il procedimento ci metterà un po'.
Linea 56: Linea 59:
Well, if the command agrees with you, hit enter (or return, whatever) and sit back & relax. This might take a while. Dopo questo avrete un file `backup.tgz`, probabilmente molto grande, all'interno della directory root del filesystem. Ora potete copiarlo su un DVD o spostarlo in un'altra macchina.
Linea 58: Linea 61:
Afterwards you'll have a file called backup.tgz, which is probably pretty large, in the root of your filesytem. Now you can burn it to DVD or move it to another machine; whatever you like!

attachment:IconsPage/IconWarning3.png WARNING: Files that are bigger than 2GB (a little less actually) are not supported by ISO9660 and may or may not be restorable. So don't simply burn a DVD with a huge .iso file on it. Split it up using the command split (see man page) or use a different way to get it onto the DVD. One possiblity (untested) is the following:
[[Immagine(Icone/Piccole/warning.png,50,left)]] Files di dimensioni maggiori ai 2GB non sono supportati da `ISO9660` e potrebbero essere o non essere ripristinabili. Non create un DVD con una unica immagine `.iso` del file, dividetelo utilizzando il comando `split` (controllate il manuale in linea di split, digitando in terminale ''man split'') o utilizzate un altro metodo per copiarlo nel DVD.
Una possibilità (non verificata) potrebbe essere:
Linea 66: Linea 67:
Note that this only backs up one file system. You might want to use --exclude instead of --one-file-system to filter out the stuff you don't want backed up. This assumes your DVD drive is /dev/hda. This will not create a mountable DVD. To restore it you will reference the device file:
Questo comando eseguirà il back-up di un solo filesystem. Potete usare `--exclude` al posto di `--one-file-system` per filtrare i files da non salvare. `/dev/hda` dovrebbe essere il vostro masterizzatore, in caso contrario modificatelo con i vostri parametri. Per ripristinare il file dovrete fare riferimento al file con:
Linea 72: Linea 72:
EDIT2:
At the end of the process you might get a message along the lines of 'tar: Error exit delayed from previous errors' or something, but in most cases you can just ignore that.
attachment:Icone/Piccole/note.png Alla fine del back-up potreste ricevere un messaggio tipo `tar: Error exit delayed from previous errors`, nella maggior parte dei casi potete ignorarlo.
Linea 75: Linea 74:
Alternatively, you can use Bzip2 to compress your backup. This means higher compression but lower speed. If compression is important to you, just substitute
the 'z' in the command with 'j', and give the backup the right extension.
That would make the command look like this:
Potete anche utilizzare '''Bzip2''' per comprimere il file di back-up. Questo porta un maggiore compressione ad una velocità minore. Se volete avere un file piccolo sostituite, nel comando la `z` con una `j` e modificate l'estensione. Il comando diventerebbe:
Linea 83: Linea 79:
=== Backup over network === == Back-up attraverso la rete ==
Linea 85: Linea 81:
If the filesystem is low on space and you can't mount another filesystem to store the backup file on it is
possible to use netcat to trasfer the backup.
Se il vostro hard-disk non ha abbastanza spazio o non potete montarne un altro in cui salvare il back-up, potete usare '''netcat''' per spostare il file di back-up.
Linea 88: Linea 83:
On the receiving end you'll setup netcat to write the backup file like this:
Dalla parte del ricevente ipmostate '''netcat''' in modo da scrivere il back-up in questo modo:
Linea 94: Linea 88:
Then you pipe the tar command without the 'f' flag through netcat on the sending end like this:
Quindi mandate in pipe il comando per eseguire il back-up, senza il flag `f`, con '''netcat''' in questo modo:
Linea 100: Linea 93:
In the above commands 1024 is just a random portnumber, anything from 1024 and up should work. attachment:Icone/Piccole/note.png Nel comando precedente 1024 è un numero di porta qualsiasi, un numero da 1024 in su dovrebbe andare bene.
Linea 102: Linea 95:
If all goes well the backup will be piped through the network without touching the filesystem being read.
With a really fast network this could actually be faster then writing the backup file back to disk.
Se tutto funziona correttamente il back-up sarà mandata in pipe attraverso la rete senza toccare il filesystem. Con una rete abbastanza veloce questo potrebbe essere più veloce dello scrivere il file sul disco.
Linea 105: Linea 97:
A variation (which I just dreamed up, so I can't testify on its reliability) on the above is this command: = Ripristinare =
Linea 107: Linea 99:
{{{
tar -cvpj <all those other options> / | ssh <remote host> "cat > backup.tar.bz2"
}}}
[[Immagine(Icone/Piccole/warning.png,50,left)]] '''Prestate molta attenzione qui. Se non capite chiaramente quello che state per fare potreste sovrascrivere file importanti per il sistema, prestate attenzione!'''
Linea 111: Linea 101:
== Restoring == [[BR]]Assicuratevi di avere i permessi di root o super-utente (consultate il [:Sudo:manuale di Sudo]) e che il file creato sia nella directory root del filesystem.
Linea 113: Linea 103:
attachment:IconsPage/IconWarning3.png Warning: Please, for goodness sake, be careful here. If you don't understand what you are doing here you might end up overwriting stuff that is important to you, so please take care! Una delle pecularietà di Linux è che tutto ciò funziona su un sistema in esecuzione, non c'è bisogno di usare CD di boot o altro. Nel caso in cui il sistema non sia più eseguibile dovrete usare un CD Live, ma i risultati sono gli stessi. Potete rimuovere qualsiasi file dal sistema mentre questo è in esecuzione, con tutto ciò che questo comporta al successivo riavvio.
Linea 115: Linea 105:
Well continue with our example from the previous chapter which created the file backup.tgz in the root directory.

Once again, make sure you are root and that you and the backup file are in the root of the filesystem.

One of the beautiful things of Linux is that this will even work on a running system; no need to screw around with boot-cd's or anything. Of course, if you've rendered your system unbootable you might have no choice but to use a live cd but the results are the same. You can even remove every single file of a Linux system while it is running with one command. I'm not giving you that command though!

Well, back on-topic.
This is the command that I would use:
Questo è il comando da utilizzare per il ripristino:
Linea 128: Linea 110:
Or if you used bz2;
Nel caso in cui sia stato utilizzato '''bunzip2''' il comando invece sarà:
Linea 134: Linea 115:
The x option tells tar to extract the file. The -C <directory> option tells tar to change to a specific directory ( / in this example ) before extracting. Alcune opzioni:
 * `x`: serve per estrarre i file nell'archivio
 * `-C <directory>: serve per spostarsi in una specifica directory, in questo caso `/`, prima di estrarre i file.
Linea 136: Linea 119:
attachment:IconsPage/IconWarning3.png WARNING: this will overwrite every single file on your partition with the one in the archive! [[Immagine(Icone/Piccole/warning.png,50,left)]] '''ATTENZIONE: questo comando sovrascriverà tutti i file della partizione con quelli presenti all'interno dell'archivio!'''
Linea 138: Linea 121:
Just hit enter/return/your brother/whatever and watch the fireworks. Again, this might take a while. When it is done, you have a fully restored Ubuntu system! Just make sure that, before you do anything else, you re-create the directories were excluded ( /proc, /lost+found, /mnt, /sys, etc.).
Premete `Invio` e rilassatevi, potrebbe metterci un po'. Quando avrà finito avrete un sistema Ubuntu completamente ripristinato. Assicuratevi anche, prima di fare qualsiasi altra cosa, di ri-creare le directory escluse durante il back-up (`/proc`, `/lost+found`, `/mnt`, `/sys'...):
Linea 144: Linea 126:
And when you reboot, everything should be the way it was when you made the backup! Al prossimo riavvio tutto dovrebbe essere come prima di effettuare il back-up.
Linea 146: Linea 128:
=== GRUB restore === == Ripristinare GRUB ==
Linea 148: Linea 130:
Now, if you want to move your system to a new harddisk or if you did something nasty to your GRUB (like, say, install Windows), You'll also need to reinstall GRUB.
There are several very good howto's on how to do that here on this forum, so i'm not going to reinvent the wheel. Instead, take a look [http://www.ubuntuforums.org/showthread.php?t=24113&highlight=grub+restore here] (forum) or here: RecoveringUbuntuAfterInstallingWindows
Se volete spostare il vostro sistema su di un altro hard-disk o se avete rovinato l'installazione di GRUB (come quando si installa Windows), dovrete re-installare GRUB.
Ci sono molti how-to validi sparsi per la rete e nei forum di Ubuntu. In particolare potete controllare RecuperoUbuntuDopoInstallazioneWindows.
Linea 151: Linea 133:
On the forum thread, there are a couple of methods proposed. I personally recommend the second one, posted by remmelt, since that has always worked for me. = Programmare il backup con cron =
Linea 153: Linea 135:
Well that's it! I hope it was helpful! L'esecuzione di queste operazioni può essere programmata, e quindi resa automatica, con il comando '''cron''' che viene dettagliatamente descritto in questa [:CronHowTo:Guida a Cron].
Linea 155: Linea 137:
== Other Methods == = Metodi alternativi =
Linea 157: Linea 139:
You might also want to check out these backup programs which will help you to make automated backups of your system:
 * [http://www.partimage.org/ Partimage]
 * [http://www.mondorescue.org/ Mondo Rescue]
Consultate la pagina BackupDelSistema.[[BR]]
Qui si trova una buona ["guida ad amanda"]
----
Documento originale: [wiki:Ubuntu/BackupYourSystem BackupYourSystem] {en}
Linea 161: Linea 144:
CategoryDocumentation CategoryCleanup

See the full discussion in this thread on the Ubuntu forums. http://www.ubuntuforums.org/showthread.php?t=70566
CategoryDaRevisionare

BR BR

Immagine(Icone/Piccole/warning.png,50,left)ATTENZIONE: Questo documento richiede una revisione. Usatelo a vostro rischio. Si raccomanda di leggere l'intera guida prima di effettuare alcuna operazione. Per una guida più aggiornata consultare la pagina BackupDelSistemaConSbackup

BR

BRQuesta guida al backup del sistema con tar è tratta da un post scritto da Heliode sul Forum Ubuntu. Questo è il thread originale della discussione: [http://www.ubuntuforums.org/showthread.php?t=35087]

Introduzione

Molti di voi probabilmente usavano Windows prima di iniziare ad usare Ubuntu. Prima o poi avrete avuto la necessità di fare il backup e ripristinare il sistema. In Windows queste operazioni richiedono software proprietario per il quale avrete dovuto riavviare il sistema e fare il boot in una sessione speciale in cui eseguire il back-up o il ripristino (questo avviene con programmi come Norton Ghost).

Sicuramente vi sarete chiesti per quale motivo non fosse possibile semplicemente salvare l'intera unità C:\ in un archivio *.zip. Quest'operazione è impossibile perchè in Windows ci sono molti files che non possono essere copiati o sovrascritti mentre sono in uso dal sistema, per questo motivo è necessario un software specifico per eseguire questa operazione.

È evidente che questa caratteristica di Windows, come il continuo reboot, è una follia. In Ubuntu non vi è alcuna necessità di usare programmi come Ghost per creare un back-up dell'intero sistema (questo avviene su ogni sistema Linux, peraltro). Del resto utilizzare Ghost su sistemi con filesystem diverso da ext2 sarebbe una pessima idea. ext3, il filesystem standard delle partizioni Ubuntu, è considerato da Ghost come un formato ext2 difettoso e ciò può causare dei danni seri ai dati salvati su di esso.

Il Back-up

Allora vi chiederete "Come faccio a fare il backup del sistema ?". La risposta è semplice: con gli stessi strumenti che utilizzi per archiviare o comprimere ogni altro file: tar. A differenza di Windows, Linux non restringe l'accesso di root per alcuni file, perciò (con i permessi necessari) puoi salvare ogni file presente nella partizione in un file *.tar. Per fare questo, è sufficiente divenire root attraverso il comando:

sudo su

e andare alla directory root del sistema (/); il metodo descritto può essere applicato a qualunque directory o partizione, comprese quelle remote o installate su unità rimovibili. Per spostarsi nella directory root digitate:

cd /

Questo è il comando da utilizzare per fare il back-up del sistema:

tar -cvpzf /backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /

Vediamo ora di spiegare questa sintassi:

  • tar: è il programma necessario a fare il back-up

  • c: crea un nuovo archivio di backup

  • v: modalità verbose, tar restituisce sullo schermo una descrizione delle operazioni in corso

  • p: mantieni permessi, mantiene intatti i permessi di tutti i files

  • z: comprime il file di back-up con gzip per renderlo più piccolo

  • f <nomefile>: specifica dove salvare il backup, /backup.tgz è il file utilizzato in questo esempio

  • Qui si mettono tutte le directory che si vogliono escludere dal back-up. Non è necessario fare il back-up di tutto quanto, alcune directory non sono indispensabili. Assicuratevi di non includere anche il file di back-up stesso, altrimenti avrete strani risultati. È meglio anche non includere la cartella /mnt, se avete altre partizioni montate lì finirete col fare il back-up anche di quelle. Assiucuratevi anche di non avere niente montato all'interno della cartella /media (ad esempio CD, CD-RW), oppure potete escludere anche la cartella /media.

  • Dopo tutte le opzioni c'è le directory di cui vogliamo fare il back-up. Utilizziamo / dato che vogliamo salvare quasi tutto.

Se volete escludere tutti gli altri filesystems, potete usare l'opzione l al posto di --exclude. Il comando precedente risulterebbe:

tar -cvpzlf /backup.tgz --exclude=/lost+found --exclude=/backup.tgz /

Se il comando è stato scritto giusto, premete Invio e rilassatevi, tutto il procedimento ci metterà un po'.

Dopo questo avrete un file backup.tgz, probabilmente molto grande, all'interno della directory root del filesystem. Ora potete copiarlo su un DVD o spostarlo in un'altra macchina.

Immagine(Icone/Piccole/warning.png,50,left) Files di dimensioni maggiori ai 2GB non sono supportati da ISO9660 e potrebbero essere o non essere ripristinabili. Non create un DVD con una unica immagine .iso del file, dividetelo utilizzando il comando split (controllate il manuale in linea di split, digitando in terminale man split) o utilizzate un altro metodo per copiarlo nel DVD. Una possibilità (non verificata) potrebbe essere:

sudo tar --create --bzip2 --exclude /tmp --one-file-system --sparse / | growisofs -use-the-force-luke -Z /dev/hda=/proc/self/fd/0

Questo comando eseguirà il back-up di un solo filesystem. Potete usare --exclude al posto di --one-file-system per filtrare i files da non salvare. /dev/hda dovrebbe essere il vostro masterizzatore, in caso contrario modificatelo con i vostri parametri. Per ripristinare il file dovrete fare riferimento al file con:

sudo tar --extract --bzip2 --file /dev/hda 

attachment:Icone/Piccole/note.png Alla fine del back-up potreste ricevere un messaggio tipo tar: Error exit delayed from previous errors, nella maggior parte dei casi potete ignorarlo.

Potete anche utilizzare Bzip2 per comprimere il file di back-up. Questo porta un maggiore compressione ad una velocità minore. Se volete avere un file piccolo sostituite, nel comando la z con una j e modificate l'estensione. Il comando diventerebbe:

tar -cvpjf /backup.tar.bz2 --exclude=/proc --exclude=/lost+found --exclude=/backup.tar.bz2 --exclude=/mnt --exclude=/sys /

Back-up attraverso la rete

Se il vostro hard-disk non ha abbastanza spazio o non potete montarne un altro in cui salvare il back-up, potete usare netcat per spostare il file di back-up.

Dalla parte del ricevente ipmostate netcat in modo da scrivere il back-up in questo modo:

nc -l -p 1024 > backup.tar.bz2

Quindi mandate in pipe il comando per eseguire il back-up, senza il flag f, con netcat in questo modo:

tar -cvpj <all those other options> / | nc -q 0 <receiving host> 1024

attachment:Icone/Piccole/note.png Nel comando precedente 1024 è un numero di porta qualsiasi, un numero da 1024 in su dovrebbe andare bene.

Se tutto funziona correttamente il back-up sarà mandata in pipe attraverso la rete senza toccare il filesystem. Con una rete abbastanza veloce questo potrebbe essere più veloce dello scrivere il file sul disco.

Ripristinare

Immagine(Icone/Piccole/warning.png,50,left) Prestate molta attenzione qui. Se non capite chiaramente quello che state per fare potreste sovrascrivere file importanti per il sistema, prestate attenzione!

BRAssicuratevi di avere i permessi di root o super-utente (consultate il [:Sudo:manuale di Sudo]) e che il file creato sia nella directory root del filesystem.

Una delle pecularietà di Linux è che tutto ciò funziona su un sistema in esecuzione, non c'è bisogno di usare CD di boot o altro. Nel caso in cui il sistema non sia più eseguibile dovrete usare un CD Live, ma i risultati sono gli stessi. Potete rimuovere qualsiasi file dal sistema mentre questo è in esecuzione, con tutto ciò che questo comporta al successivo riavvio.

Questo è il comando da utilizzare per il ripristino:

tar -xvpzf /backup.tgz -C /

Nel caso in cui sia stato utilizzato bunzip2 il comando invece sarà:

tar -xvpjf backup.tar.bz2 -C /

Alcune opzioni:

  • x: serve per estrarre i file nell'archivio

  • -C <directory>: serve per spostarsi in una specifica directory, in questo caso /`, prima di estrarre i file.

Immagine(Icone/Piccole/warning.png,50,left) ATTENZIONE: questo comando sovrascriverà tutti i file della partizione con quelli presenti all'interno dell'archivio!

Premete Invio e rilassatevi, potrebbe metterci un po'. Quando avrà finito avrete un sistema Ubuntu completamente ripristinato. Assicuratevi anche, prima di fare qualsiasi altra cosa, di ri-creare le directory escluse durante il back-up (/proc, /lost+found, /mnt, `/sys'...):

mkdir /proc /lost+found /mnt /sys

Al prossimo riavvio tutto dovrebbe essere come prima di effettuare il back-up.

Ripristinare GRUB

Se volete spostare il vostro sistema su di un altro hard-disk o se avete rovinato l'installazione di GRUB (come quando si installa Windows), dovrete re-installare GRUB. Ci sono molti how-to validi sparsi per la rete e nei forum di Ubuntu. In particolare potete controllare RecuperoUbuntuDopoInstallazioneWindows.

Programmare il backup con cron

L'esecuzione di queste operazioni può essere programmata, e quindi resa automatica, con il comando cron che viene dettagliatamente descritto in questa [:CronHowTo:Guida a Cron].

Metodi alternativi

Consultate la pagina BackupDelSistema.BR Qui si trova una buona ["guida ad amanda"]


Documento originale: [wiki:Ubuntu/BackupYourSystem BackupYourSystem] {en}

CategoryDaRevisionare