[linux-lvm] dd of a used part of a logical volume?

Wolfgang Weisselberg uzx87lvfmukwc001 at sneakemail.com
Thu Jun 3 14:57:53 UTC 2004


Alexy Khrabrov wrote 40 lines:

[undeleting files w/ReiserFS]

> Now I'd like to play with the dd copying of the whole reiserfs (I'm
> avoiding the word partition since it covers the whole logical volume
> which spans the whole RAID device).

To any file system a logical volume is a partition.  

It just happens that the underlying system may be split over
several hard disks and do not even have to be continous --- just
as LVM sees a single hard drive, but in reality it's several hard
drives joined by a RAID system.

> I simply do not have space to copy
> the whole RAID, but the size of the used space on this reiserfs volume was
> under about 9 GB.  I wonder how can I copy just about that -- I assume it
> fills the logical volume contiguously,

And each time a file grows, you have to jump to the end of the
currently used space, just for that?  That's one of the things
that makes FAT a simple, slow file system.  ReiserFS --- and
most other intelligent file systems --- spread their data over
the whole disk, so even if files grow, the number of jumps the
hard disk head has to make to read a file completely stays low.

> Are there LVM methods to shrink it/copy just the used blocks in
> conjunction with reiserfs, such as resize_reiserfs?

How about asking if your RAID can't do that?  How *can* LVM know
if one chunk of it's space allocated to ReiserFS has been used
by ReiserFS or not?  And what if your precious files were on a
chunk that's *now* unused?

And even if LVM left out the blocks, wouldn't ReiserFS say "Go
block X (roughly 140 GB from the start) and read this block"
and wouldn't it be just too bad if you only had 9 GB, so this
search would fall wide outside the data range you have?

Do you really want LVM to know all intricacies of all file systems,
just to be able to do the job of a completely different tool,
badly?

-Wolfgang



More information about the linux-lvm mailing list