Skip to contentSkip to conversation

Userspace cp and ls utility

DISCUSSION Jan Dittmer 2 participants 5 messages Jul 21, 2006 – Jul 23, 2006

lore
Share & tools
lore
#0 lore raw

Are there utilities for xfs which are able to ls and cp from an _unmounted_ xfs volume? I fear that by mounting the volume - even ro - I would lose even more data.
Or can I achieve such an effect with other xfs related utilities?

Thanks,

Jan

#1 lore raw
Quoted 6 lines · Jan Dittmer

Are there utilities for xfs which are able to ls and cp from an _unmounted_ xfs volume? I fear that by mounting the volume - even ro - I would lose even more data.
Or can I achieve such an effect with other xfs related utilities?

Mounting ro should be fine - if you also mount with "norecovery" then truly no IO should happen. If you're really paranoid, find a utility to mark the block device itself as read-only, then you've taken it out of the filesystem's hands completely.

You could also try xfs_copy, it makes a copy of the filesystem and works on the underlying device, with the filesystem unmounted. There's a man page for it.

-Eric

#2 lore raw
Quoted 11 lines · Eric Sandeen
Quoted 6 lines · Jan Dittmer

Are there utilities for xfs which are able to ls and cp from an _unmounted_ xfs volume? I fear that by mounting the volume - even ro - I would lose even more data.
Or can I achieve such an effect with other xfs related utilities?

Mounting ro should be fine - if you also mount with "norecovery" then truly no IO should happen. If you're really paranoid, find a utility to mark the block device itself as read-only, then you've taken it out of the filesystem's hands completely.

Thanks for the suggestions. Meanwhile I found the norecovery option myself and got most of my data back. Strangely enough I had one top directory missing on one mount attempt (only ro option) and it appeared again on the next attempt (ro + norecovery).

Quoted 1 line

You could also try xfs_copy, it makes a copy of the filesystem and works on the underlying device, with the filesystem unmounted. There's a man page for it.

Is there any difference to using dd when the destination is no xfs filesystem? And if I read the description correctly it does not allow to copy individual files?

Thanks,

Jan

#3 lore raw
Quoted 5 lines · Jan Dittmer
Quoted 1 line

You could also try xfs_copy, it makes a copy of the filesystem and works on the underlying device, with the filesystem unmounted. There's a man page for it.

Is there any difference to using dd when the destination is no xfs filesystem? And if I read the description correctly it does not allow to copy individual files?

xfs_copy knows about the xfs format, so it only copies what it needs to. dd will copy every bit on the source disk. So, xfs_copy is more efficient. There is no option to copy individual files.

Depending on the problem with your original filesystem, perhaps xfs_copy might not be the best choice.

-Eric

#4 lore raw
Quoted 5 lines · Eric Sandeen
Quoted 3 lines · Jan Dittmer
Quoted 1 line

You could also try xfs_copy, it makes a copy of the filesystem and works on the underlying device, with the filesystem unmounted. There's a man page for it.

Quoted 8 lines
Quoted 3 lines

Is there any difference to using dd when the destination is no xfs filesystem? And if I read the description correctly it does not allow to copy individual files?

xfs_copy knows about the xfs format, so it only copies what it needs to. dd will copy every bit on the source disk. So, xfs_copy is more efficient. There is no option to copy individual files.

Depending on the problem with your original filesystem, perhaps xfs_copy might not be the best choice.

Well I suffered from the 2.6.17 endian bug and had fun with dis- and re- appearing folders upon xfs_repair and mount runs.
After all the 'only' thing I lost from my 600+gb volume are one or two mailing list folders and most of my inbox (for which I've backups). Seems to only affect folders which were open at the wrong moment.

Now I reformated the whole volume and restore the data from other disks.

Jan