PDA

View Full Version : Include in-place file system conversion tool (convertfs)...



Vince
04-23-2003, 08:33 PM
Hi all,

A suggestion for a tool that would be REALLY usefull on the Knoppix CD :

http://tzukanov.narod.ru/convertfs/

(it should take less than 150KB so it should probably fit on the cd... ?)

Please note that I've not (yet) tested this software, but this is really something I would have needed a couple of times (doing this using tar and/or netcat is not fun at all, and you need another HD/computer...)

Please let me know what you think about this suggestion...

Vincent

Vince
04-25-2003, 11:27 AM
No reply/feedback at all... am I really the only one interested in such a feature ???

=========================================
convertfs v1.3

Convert filesystem on device from this type to this type.

Usage: convertfs device from_fs_type to_fs_type

Filesystem types: minix xfs jfs reiserfs ext2 ext3

Example: convertfs /dev/hda2 ext2 reiserfs
=========================================

garyng
04-25-2003, 02:08 PM
Is it in-place ? I browse briefly and it seems like a tar out/reformat/tar in to me.

Vince
04-25-2003, 02:31 PM
Yes, it is:



This simple toolset allows you to change type of file system in the lack of backup space. The idea
is to use sparse files support of primary filesystem. We create a sparse image of block device, mkfs secondary filesystem on it, mount it, mv files from primary filesystem to mounted image and then
map image to the device.


Thus (if I understand correctly) the only condition is that the free space on the partition you want to convert has to be be bigger than the size of the biggest file on the partition - so that you can move it to the sparse image. No other disk/partition needed ! I don't know any other tool that can achieve the same in linux...

garyng
04-25-2003, 04:21 PM
What does it mean by sparse image ? I don't quite understand how it does it.

Vince
04-25-2003, 05:25 PM
From http://www.nic.com/~cheah/hole.html : "On many Unix filesystems, files containing long strings of nulls can be stored much more efficiently than other files. To be specific, if a string of nulls spans an entire allocation block, that whole block is not stored on disk at all. Files where one or more blocks are omitted in this way are called sparse files. The missing blocks are also known as holes."

That makes possible e.g. to have a 1TB file on a 1GB partition, provided that the file is filled at 99.9% with nulls. Anyway, the image of the partition is initially a sparse file (which means that it takes effectively 0 space on disk, even if it looks like a file that is as big as your whole partition !), and the effective size (i.e. size taken on disk) of the image will grow up as the files are moved into that image (which on the other side will free space on the partition, thus the total space used on the partition is almost constant)...