View previous topic :: View next topic |
Author |
Message |
Localhost-29A n00b
Joined: 30 Aug 2014 Posts: 48
|
Posted: Wed Sep 17, 2014 10:12 am Post subject: [Solved] BackUp the entire system with dd gives me 2 errors. |
|
|
Hi, I want to backup my entire system by using dd from my primary HD to my secondary one, but I'm having some issues I don't know how to solve, these are my problems:
1º) dd writes all data as read-only and I can't do nothing about it. (I don't know how to change it).
2º) It makes me duplicates volume (that make sense) but when I try to label each volume in my system's image I can't because it is read-only and I don't know how to label my primary volumes without erasing all my data.
Is there any way to do this better, or fix this problems? Thanks in advance.
Last edited by Localhost-29A on Wed Sep 17, 2014 9:03 pm; edited 1 time in total |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Wed Sep 17, 2014 1:46 pm Post subject: |
|
|
I'm not sure why you're using dd to backup? It will make a direct duplicate and really only makes sense if you want to make an exact duplicate snapshot. There are a lot of problems with doing this on a live machine, namely that there are open files that are half baked...
You should look into some other backup system, perhaps using rsync or tar or some other software. Or are there other issues that you're trying to solve (like boot sector/partition backup, etc.)? _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Localhost-29A n00b
Joined: 30 Aug 2014 Posts: 48
|
Posted: Wed Sep 17, 2014 7:50 pm Post subject: |
|
|
I'm trying to have an exact image (clone) of my system in an external HD (which I don't even mount most of the times), and if I somehow screw all what I have overwrite my primary system with that copy/clone/image, and I'm using dd because is the best think I know that does what I want or something near to what I want. But I'm having that issues and i don't know how to walk through/around them. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8708 Location: ~Brussels - Belgique
|
Posted: Wed Sep 17, 2014 8:24 pm Post subject: |
|
|
If it's a Linux filesystem, rsync or cp, or tar will be good enough. dd copy all the disk, including internal IDs and unoccupied space, this is a huge waste of space.
Even more, if your disk is dead, it won't be a good idea to restore the content to an other one, except if it has the same geometry.
For other filesystems, I use partimage. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Wed Sep 17, 2014 8:25 pm Post subject: |
|
|
Localhost-29A,
Using dd on a live system will give you problems with files that are open for writing and your filesystems will always be marked 'dirty', hence will mount read only..
It will be fine if you boot something else and use that for dd.
The reccomended way to do what you want is with a stage4 plus a dd of the space before the first partition, so you get the partition table and boot loader.
If you use a GPT partition table its slightly harder as there are two copies of the partition table, one at the start and one at the end of the drive.
The stage4 alone will let you restore your system bet you will need to partition the drive by hand and use a chroot to install the boot loader in any restore. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Irre Guru
Joined: 09 Nov 2013 Posts: 434 Location: Stockholm
|
Posted: Wed Sep 17, 2014 8:37 pm Post subject: |
|
|
I think it is better to use "partimage" to backup partitions into compressed files rather than cloning hd.
If your filesystem is not supported by "partimage" (ext4, f2fs, ufs ..) you can use dd to backup:
dd if=/dev/sdaX | gzip > backupfile
and dd to restore:
zcat backupfile | dd of=/dev/sdaX
/dev/sdaX must not be mounted. To save space in backupfile fill the free space in filesystem temporary with zeroes. |
|
Back to top |
|
|
Localhost-29A n00b
Joined: 30 Aug 2014 Posts: 48
|
Posted: Wed Sep 17, 2014 9:03 pm Post subject: |
|
|
NeddySeagoon wrote: | Localhost-29A,
Using dd on a live system will give you problems with files that are open for writing and your filesystems will always be marked 'dirty', hence will mount read only..
It will be fine if you boot something else and use that for dd.
The reccomended way to do what you want is with a stage4 plus a dd of the space before the first partition, so you get the partition table and boot loader.
If you use a GPT partition table its slightly harder as there are two copies of the partition table, one at the start and one at the end of the drive.
The stage4 alone will let you restore your system bet you will need to partition the drive by hand and use a chroot to install the boot loader in any restore. |
I think this is the closest to what I wanted without using any third part solution. Thanks. |
|
Back to top |
|
|
|