[clug] duplicate a file system to a smaller hard disk
david at tulloh.id.au
Mon Aug 10 08:35:24 MDT 2009
Chris Zhang wrote:
> Hi List,
> I have been looking for a way to clone a complete working Linux system
> on a 250GB (22GB used) hard disk to a smaller hard disk. A lot of
> places mentioned dd, but the destination will have to be at least as
> big as the source. I have thought about creating an image of an
> appropriate size and copy everything from the bigger hard drive onto
> that image and use dd to put the image onto a smaller disk. I guess
> some work will also be needed on setting up the partition table and
> bootloader on the smaller harddisk.
> It is just a thought and I don't have a clear idea as to how exactly I
> am able to do it. Does anyone have any ideas? I am very open to
> completely new approaches.
While I agree with other posters that simply copying all the files would
be easier I believe it's also possible to clone the whole structure as
you originally requested.
The first step is to resize the existing filesystem down to the smaller
disk, this can only be done for some filesystems.
Then use dd as the guides you have already found suggested.
I have resized reiserfs partitions in the past (made the partition
bigger). I believe you can also resize ext2 and ext3 by converting it
to ext2. I'm not sure about the others.
More information about the linux