Hylton Conacher (ZR1HPC) wrote:
Hi Per,
On 21/08/14 17:04, Per Jessen wrote:
Hylton Conacher (ZR1HPC) wrote:
Hi,
I have a production system that runs OpenSuSe 11.2 that currently acts as a fileserver, mail gateway and workstation. This same production system is on older hardware and thus cannot boot from USB, but can from DVD/CD. The version of dd in Coreutils is 7.1.
My aim is to to upgrade this software to to the latest and greatest the hardware will allow, however before doing a fresh install, I need to preserve the user file and mail server stores i.e. non root users.
The entire system is under 2GB and given I have a a 2TB Drobo storage unit attached via USB that is owned by root, I assume this to be possible.
With the insertion of a Live CD to detect the system and attached USB connected drive array(Drobo), could I use dd to copy the system across and preserve all user permissions, users, groups etc?
Hylton, you will want to use tar or cpio, not dd.
Why do you say to not use dd?
Because dd can only save individual files... you can use it to back up a partition, but you do it in a way that is similar to making a .iso of a CD or DVD.. dd does NOT understand filesystems, so if you want to save a directory tree, you have to copy the ENTIRE partition that the directory tree is on. dd is a very good tool, but it's not the tool for THIS job. It does thinks that cat cannot do (such as read past an end-of-file character) and do block i/o... but it has limitations, also. It is virtually unchanged since the 1960's -- NO CODE has ever been added throughout the last 45 years for dd to understand filesystems, or directory structures, or to give it the ability to walk through a directory structure. This is in complete contrast to other tools like find, which understands directory structures and various aspects of unix filesystems very well, but it has no built-in ability to copy data. The Unix software design philosophy... and therefore the Linux software design philosophy, is that a large number of small tools, each of which does one thing very, very well, is superior to a couple of tools which do many things, because it will do most of those things poorly in comparison to specialized tools. This is because small tools are easier to debug, and they also don't hog memory.
I figured that would be the easiest as it seems to be the most simple command.
It is a simple command In fact, for YOUR purposes, it is TOO simple of a command. But don't worry, the rsync syntax is even simpler. Rsync is a very sophisticated command, and it best of all it hides all of that sophistication behind a very VERY simple command line interface.
That said however, I do suppose though that using tar or cpio and having one entire file is easier to move around, although without compression, HORRIBLY LARGE. I have just double checked the size of /home directory and at 97GB, that is one MONSTER file so creating an archive is not advisable I would think.
Realize that if you used dd, you would be creating a 100 GB file, and one which would be relatively difficult to extract files from (for a user with your level of experience). If you used tar, you would create a 100 GB file, which would be easier to extract data from in one sense, but more difficult to get the command line right. If you use rsync, the operation will take longer, but it will give you an archive which is both easy to use, and it's easy to create.
So I am not looking at creating and archive file, merely an exact replica to enable bare-metal restore, if necessary,
Actually, you want an archive. And you want that archive to be in the form of a directory tree, not an archive file. Trust me. I've dealt with this issue so many times I've lost count, both on my linux computers at home, AND on hundreds of Unix computers in my places of employment.
that I can write to a USB attached HDD device of 2TB owned by root.
Rsync will do that perfectly, and in a manner that will give you a result you really want. If you use dd, you will use up 100GB of your 2000GB USB drive, and the rest of the space will be wasted. WASTED.
I guess cp would work, but take AGES.
That's true...but it goes with the territory (100GB of data to transfer). I just recently upgraded two 500 GB drives in my laptop to 750 GB drives. Was it fast? No. Oh well. But on the plus side, using cp or rsync gives me the opportunity to optimize the data layout on the new disk, in ways that dd never would.
My rsync version is 3.0.6 and SSH is not set-up so using rsync is apparently not possible, although given its a copy from a machine to a locally attached hdd, there is no security needed. Given its a local copy why is SSH a factor?
then use cp. If it's a USB drive, cp with the -R and -P flags should do the job perfectly USB=/wherever/your/2TB/USB/drive/is/mounted HOME=$USB/home.backup mkdir $HOME cp -P -R /home $HOME
So I'm stuck. How to not lose any data or set-up and configuration files but still do a fresh install of 13.1. Those set-up and config files I assume are in /etc and might be needed
copying doesn't cause data loss. By the way, the use of dd is tricky enough that I've seen experienced admins screw up and overwrite working partitions with the contents of the blank backup media. The results are never pretty.
I'm thinking more and more of rsync but think I would need to possibly change the ownership of the locally attached USB hdd to the same user as whom I want to backup.
su to root, and there is no problem.
Help! I'm open to suggestions to accomplish what I seek, if possible.
Regards Hylton
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org