[opensuse] dd - rsync question
Hello SuSE people, I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync? Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bob S wrote:
Hello SuSE people,
I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync?
Bob S
_what_ did you backup with dd? a filesystem? or a partition or whole drive that might have more than one filesystem? You can loopback mount a filesystem and update it's contents. For instance if you did just a filesystem: If your "/" is/was /dev/sda3 and you dd'd it to an external drive: dd if=/dev/sda3 of=/media/my_external_drive/sda3.dd You can update it's contents like this: mkdir /oldsda3 mount -o loop /media/my_external_drive/sda2.dd /oldsda3 rsync -axv --inplace --del /* /oldsda3 umount /oldsda3 The x in the rsync options means don't include other filesystems. Thats a quick way to exclude several problems at once such as oldsda3 itself and sys proc dev, but it also means any other seperate filesystems you do want, you need to include with separate rsync commands. Or use a single fancier rsync command using --filter or --exclude or --include etc which you are free to figure out yourself. If you dd'd a whole drive with multiple partitions and multiple filesystems, that takes extra steps and there are are a couple ways. Ypu can follow this to see how to find out the offsets of the different filesystems within the dd image and use the offset option to mount. http://www.andremiller.net/content/mounting-hard-disk-image-including-partit... Or you can use losetup and kpartx. I think this is easier and safer because you don't have to figure out the offsets or risk getting them wrong. losetup first to make a block device that maps to the file. # losetup -v -f sda.dd Loop device is /dev/loop0 Now /dev/loop0 is like /dev/sda a device node that maps to an entire drive. Now kpartx to create /dev/mapper/* device nodes which map to the various partitions within the "drive" # kpartx -av /dev/loop0 add map loop0p1 (253:0): 0 97632 linear /dev/loop0 32 add map loop0p2 (253:1): 0 19584 linear /dev/loop0 97664 add map loop0p3 (253:2): 0 931328 linear /dev/loop0 117248 This created: /dev/mapper/loop0p1 /dev/mapper/loop0p2 /dev/mapper/loop0p3 /dev/mapper/loop0p3 is the 3rd partition in the image, so if that was your "/" then: Mount it: mkdir /oldsda3 mount /dev/mapper/loop0p3 /oldsda3 Update it: rsync -axv --inplace --del /* /oldsda3 Now unmount and unmap everything: umount /oldsda3 kpartx -dv /dev/loop0 losetup -d /dev/loop0 -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 02/01/10 22:45, Brian K. White wrote:
Bob S wrote:
Hello SuSE people,
I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync?
Bob S
_what_ did you backup with dd? a filesystem? or a partition or whole drive that might have more than one filesystem?
[rest pruned] I don't think that the majority of people have the ability to place themselves in the position of being the recipients of such requests and therefore do not provide the obvious details necessary for respondents to provide the answer(s). Unfortunate, but true. If one has been in the position of answering questions/queries from others then one very quickly learns to provide some basic information at least when asking for assistance. Otherwise there is such a waste of time and effort - as your response shows. Nobody here, nor elsewhere, is a mind reader....... Ah well, such is life..... And as a consequence, I do not get (too) upset with developers et alia when they have to fend similar questions. BC -- If you don't succeed you run the risk of failure. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 02 January 2010 01:59:55 Basil Chupin wrote:
On 02/01/10 22:45, Brian K. White wrote:
Bob S wrote:
Hello SuSE people,
I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync?
Bob S
_what_ did you backup with dd? a filesystem? or a partition or whole drive that might have more than one filesystem?
[rest pruned]
I don't think that the majority of people have the ability to place themselves in the position of being the recipients of such requests and therefore do not provide the obvious details necessary for respondents to provide the answer(s). Unfortunate, but true.
What? is your friggin problem Basil ?? Your post is nothing but clutter and chaff and contributes nothing to the query.
If one has been in the position of answering questions/queries from others then one very quickly learns to provide some basic information at least when asking for assistance.
Pretty basic I thought. Simple question. Can a dd backup be modified or used with rsync. Brian seemed to understand it very well and provided a very thorough and expliucit answer. Sorry that you couldn't.
Otherwise there is such a waste of time and effort - as your response shows.
The only waste of time was your reply to the post with nothing to contribute.
Nobody here, nor elsewhere, is a mind reader.......
Ah well, such is life.....
Yep, takes all kinds I guess.
And as a consequence, I do not get (too) upset with developers et alia when they have to fend similar questions.
Too bad the devs you know aren't as logical, understanding or patient as Brian is. Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2010-01-02 at 21:04 -0500, Bob S wrote:
If one has been in the position of answering questions/queries from others then one very quickly learns to provide some basic information at least when asking for assistance.
Pretty basic I thought. Simple question. Can a dd backup be modified or used with rsync. Brian seemed to understand it very well and provided a very thorough and expliucit answer. Sorry that you couldn't.
Brian guessed how you did the dd, and then gave an answer. I also guessed, in his line too, but refrained from writting till you confirm what dd command you used. Your post does not have sufficient info, Bob. We can guess what you did, and then give an answer - which can be correct, or totally incorrect if we guess wrongly, and thus, waste our time. Or worse, give an answer which can destroy your data. Notice that dd can do many types of copy "things". - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAktAAKUACgkQtTMYHG2NR9WUvwCeLJVbhgZyJmHKuYiRvMrAdt3a eVgAnj26FO5tIrz6k4HlmtrKetehqRYS =HlTC -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bob S wrote:
On Saturday 02 January 2010 01:59:55 Basil Chupin wrote:
On 02/01/10 22:45, Brian K. White wrote:
Bob S wrote:
Hello SuSE people,
I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync?
Bob S _what_ did you backup with dd? a filesystem? or a partition or whole drive that might have more than one filesystem? [rest pruned]
I don't think that the majority of people have the ability to place themselves in the position of being the recipients of such requests and therefore do not provide the obvious details necessary for respondents to provide the answer(s). Unfortunate, but true.
What? is your friggin problem Basil ?? Your post is nothing but clutter and chaff and contributes nothing to the query.
His post may or may not have been strictly necessary, but it was not wrong at the time he wrote it, and it is still not wrong even now that you have tried and failed to answer my question about what exactly did you dd. Your answer is self contradictory and nonsense. So basically, though I don't have a problem with you personally and don't mean to be giving you a hard time, he was actually correct. Just for the record is all... If you hadn't attempted to give him a hard time while being technically in the wrong, while he was technically in the right, I'd not have bothered to make an issue. Since there was only two basic possibilities, and not an impractically large tree or possibilities, I just answered both and was happy to leave it at that. It makes a useful reference even for myself to consult later. Hope you're not insulted. I have no problem insulting someone when I think it's called for or when I just feel in the mood for it, but, I do like to follow Robert A. Heinlein's advice: "Never insult someone by accident." :) And it's not my goal with you at the moment. Just calling shenanigans is all. -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2010-01-02 at 06:45 -0500, Brian K. White wrote: ...
Or you can use losetup and kpartx. I think this is easier and safer because you don't have to figure out the offsets or risk getting them wrong. losetup first to make a block device that maps to the file. # losetup -v -f sda.dd Loop device is /dev/loop0 ...
This created: /dev/mapper/loop0p1 /dev/mapper/loop0p2 /dev/mapper/loop0p3
This is very intereting. Thanks :-) - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAks/GrkACgkQtTMYHG2NR9UmYACgle5Y8XQ0NNFjcMoMgrLLnqu7 rswAmwUH8Jdb66Yl1UhR3aqG6K8Ebk0v =dvSo -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 02 January 2010 06:45:11 Brian K. White wrote:
Bob S wrote:
Hello SuSE people,
I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync?
Bob S
_what_ did you backup with dd? a filesystem? or a partition or whole drive that might have more than one filesystem?
Hello Brian. Thanks for your reply. I backed up one filesystem, oS 11.2 consisting of four partitions.
You can loopback mount a filesystem and update it's contents.
For instance if you did just a filesystem: If your "/" is/was /dev/sda3 and you dd'd it to an external drive: dd if=/dev/sda3 of=/media/my_external_drive/sda3.dd
You can update it's contents like this: mkdir /oldsda3 mount -o loop /media/my_external_drive/sda2.dd /oldsda3 rsync -axv --inplace --del /* /oldsda3 umount /oldsda3
The x in the rsync options means don't include other filesystems. Thats a quick way to exclude several problems at once such as oldsda3 itself and sys proc dev, but it also means any other seperate filesystems you do want, you need to include with separate rsync commands. Or use a single fancier rsync command using --filter or --exclude or --include etc which you are free to figure out yourself.
I would stick with the individual rsync commands otherwise it would get too complicated and mistake prone for me. Besides, I only wasnt to deal with one partition.
If you dd'd a whole drive with multiple partitions and multiple filesystems, that takes extra steps and there are are a couple ways. Ypu can follow this to see how to find out the offsets of the different filesystems within the dd image and use the offset option to mount. http://www.andremiller.net/content/mounting-hard-disk-image-including-parti tions-using-linux
Good info. Filed for the future. Don't think I would ever do a whole drive though. Never know.
Or you can use losetup and kpartx. I think this is easier and safer because you don't have to figure out the offsets or risk getting them wrong. losetup first to make a block device that maps to the file. # losetup -v -f sda.dd Loop device is /dev/loop0
Don't knowof losetup and kpartx but filed for future use if needed.
Now /dev/loop0 is like /dev/sda a device node that maps to an entire drive. Now kpartx to create /dev/mapper/* device nodes which map to the various partitions within the "drive"
# kpartx -av /dev/loop0 add map loop0p1 (253:0): 0 97632 linear /dev/loop0 32 add map loop0p2 (253:1): 0 19584 linear /dev/loop0 97664 add map loop0p3 (253:2): 0 931328 linear /dev/loop0 117248
This created: /dev/mapper/loop0p1 /dev/mapper/loop0p2 /dev/mapper/loop0p3
/dev/mapper/loop0p3 is the 3rd partition in the image, so if that was your "/" then: Mount it: mkdir /oldsda3 mount /dev/mapper/loop0p3 /oldsda3
Update it: rsync -axv --inplace --del /* /oldsda3
Now unmount and unmap everything: umount /oldsda3 kpartx -dv /dev/loop0 losetup -d /dev/loop0
Thanks for your very detailed and enlightening explanation. As I stated goes into my info for future use file. Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2010-01-02 at 20:47 -0500, Bob S wrote:
On Saturday 02 January 2010 06:45:11 Brian K. White wrote:
_what_ did you backup with dd? a filesystem? or a partition or whole drive that might have more than one filesystem?
Thanks for your reply. I backed up one filesystem, oS 11.2 consisting of four partitions.
The question is what exact command you used, or at least the more exact aproximation you can tell us. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAks/+Z8ACgkQtTMYHG2NR9XzkQCfQFyGw/q6/SjC4RcXEbUSvyI6 4EcAoIsfEkOzbvF16bpm8MJDYZrVKwyv =tlW9 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/01/02 20:47 (GMT-0500) Bob S composed:
Brian K. White wrote:
Bob S wrote:
I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync?
_what_ did you backup with dd? a filesystem? or a partition or whole drive that might have more than one filesystem?
Thanks for your reply. I backed up one filesystem, oS 11.2 consisting of four partitions.
To me the primary meaning of filesystem, absent an immediate modifier, is what results from executing a format or mkfs command, which, in the absence of LVM and/or RAID, applies to one single HD partition. IOW, "root filesystem" and "filesystem" do not necessarily mean the same thing. A root filesystem can contain much more than mounted HD partitions, including ramdisks, unpartitioned media, remote shares, and a whole bunch of strange objects in /dev. I would likely never consider using dd to "backup" /, which is what your response to Brian seems to say is what you did. -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 01 January 2010 23:01:11 Bob S wrote:
Hello SuSE people,
I did a dd backup on my 11.2. Question is can I update it with rsync, or more important could I restore certain files/directories using rsync?
To all of the most respected and knowledgeable people on this list. I really believed I was asking a very general and simple question as stated above. I have been chastized by some of those very same people for my incomplete description of what I requested. I stand corrected and I apologize for my ignorance, I hope you will bear with me should I demonstrate my ignorance again in the future. I will try harder. Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Basil Chupin
-
Bob S
-
Brian K. White
-
Carlos E. R.
-
Felix Miata