[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: xfs file system - apparently for real men 8-)



On Wed, 05 Dec 2001, Bret Waldow wrote:
> Thanks for the tips.  Maybe you can help with this newbie question...

Interestingly, just after I posted this I found that Daniel Phillips has
posted some tests done with ReiserFS, comparing it's indexing to his
ext[23] directory indexing.

This showed that the hash _default_ function in ReiserFS performs poorly
when names are randomly distributed rather than sequential. :)

> I have a Thinkpad, dual boot W2k & Linux. I bought a second hard disk,
> identical to the one that came with the laptop, and a carrier for the
> Ultrabay.

Cool. How do those work? I am thinking of replacing my Gateway laptop
with a Thinkpad, now that Gateway have closed down their Asia-Pacific
operation entirely. :(

> My backup is: dd if=/dev/hda of=/dev/hdc
> 
> This works great, but I expect it's copying my (you guessed it)
> reiserfs partitions verbatim.

*nod*  Everything, in fact. :)

> So I imagine if I wanted to reformat with different partition types,
> to restore I'd go in on an hdaX level, like hda5 = hdc5, but I can't
> do a byte for byte copy if I want to end up with a different fs type.

Well, sort of. You can't change the content of the filesystem doing
things like that. So, you want to copy the /content/ rather than the raw
bytes.

> What command would work, please? I figured I might need to answer this
> question some day, but maybe sooner is better.

The two popular choices for this are tar(1) and cpio(1). :)

Basically, plug in both hard disks and boot from something that you will
not be modifying. I have done this using Debian install disks and
mini-linux distributions as well as by moving root from partition to
partition.

Basically, the process is:

* make sure the partition you are changing is unmounted
* make sure all it's data is backed up
* make sure it's unmounted again (because you forgot to backup first,
  right ;)

Now, this is where it starts to get potentially destructive, so be
careful.

* mount the duplicate partition and make sure it's got the right data.

Once you have done that, make sure your backups are up to date and:[1]

* mke2fs (or whatever) the partition you are changing to a new type.
* mount it somewhere, possibly in it's correct location

* execute:
] (cd /mnt/old && tar cp .) | (cd /mnt/new && tar xvp)

Verify, by reading the manpage and info for tar, that these are enough
options for you. Do this as *ROOT*, because anything else *will not
work*.[2]

* check your level of paranoia
* assuming it's high, do something like (assuming you use bash as your shell):
] cd /mnt/new && find . -type f -print | while read file; do
      cmp "$file" "/mnt/old/$file" ||
      echo -e "\007\007\007\007\007 **** $file is corrupt! help! help!"
  done | tee /tmp/compare.log

This verifies that the files on the old and new partition are
byte-for-byte identical. This probably matters to you, but skip it if
you are sure that you got it right.


Then, unmount the old partition and *KEEP IT FOR A MONTH!!!!!*

Don't delete it. Make sure it's available just in case you forgot
something vital on it. Really.

*grin*

Oh, there are other tools that might work in place of tar or cpio, too.
rsync(1) works, and there are a number of "directory tree clone"
programs out there that should work too.

Also, something that's a file level backup tool like kbackup should
work, modulo the fact that I have not /tried/ this.

Personally, I just used tar. :)

        Daniel

Footnotes: 
[1]  Have I labored this point enough yet?

[2]  Unless you want all the files in the target to be owned by that
     user. I do my home directory, on those rare occasions when I do
     move it, as a normal user.

-- 
And when they come to ethnically cleanse me, 
Will you speak out? Will you defend me? 
Or laugh through a glass eye as they rape our lives, 
Trampled underfoot by the right on the rise.
        -- Pop Will Eat Itself, _Ich Bin Ein Auslander_ (Dos Dedos Mis Amigos)



Reply to: