Backup Complete Hard Drive
Fred Roller
froller at tnclimited.com
Thu Dec 10 14:56:09 UTC 2009
kate wrote:
> I have now used the backup and restore commands in Terminal with out any
> problems when it comes to files and directories, but the situation is
> that I can not back up the whole hard drive to a external hard drive
> complete.
>
> For Example to test the system I have placed jpegs onto desktop and
> executed a complete dump after I have used the restore command to place
> back all the data, that has worked but the desktop dose not show or
> replace the files that I have deleted as a test.
>
> What I mean is do a complete system back up onto a external hard drive,
> erase or format the original and place back all directories and files as
> it was originally.
>
>
> Thanks Kate
>
>
>
Sounds like you would be better served with DD:
Backup:
dd if=/dev/sda1 of=/media/[external drive]/backup.img bs=512
Restore: (which requires no formatting and may be defeating the purpose):
dd if=/media/[external device]/backup.img of=/dev/sda1 bs=512
you need to be able to umount the /dev/sda1 device or boot from a live
cd to complete. If on the other hand you just need the data files then
tar would serve:
Backup:
tar -cvf /media/[external device]/backup.tar /path/to/directory
example:
froller at metis:~$ tar -cvf /Crypt/backups/test.tar test
test/
test/test1
test/test2
Restoration:
tar -xvf /media/[external device]/backup.tar -C /path/to/directory
example:
froller at metis:~$ tar -xvf /Crypt/backups/test.tar -C /home/froller/
test/
test/test1
test/test2
in the restore example the -C /home/froller/ is not needed because I am
already in the working directory, just used it to show it could be used
if you were /not/ in the working directory. Hope this helps. In double
checking my work I did come across this:
http://www.faqs.org/docs/gazette/backup.html
which may be of some interest. Good luck.
--
Fred
www.fwrgallery.com
"Life is like linux, simple. If you are fighting it you are doing something wrong."
More information about the ubuntu-users
mailing list