Shadok, thank you very much.
I did it. Below is short description.
There was 1500 GB drive with 60 GB data and 7GB swap. Quite regular setup, ext3 system Linux Debian Squeeze.
I wanted to swap this big drive to a 250 GB drive.
- I downloaded and burned The Parted Magic distro LiveCD. This
distro contains Gparted (partition tool) and Clonezilla. Though I
used only Gparted.
- Connected both drives and booted from LiveCD.
- Opened partition tool (Gparted) and shrinked the main partition
on source drive from something 1500 GB to 100 GB. (It takes time).
And there was swap partition, we will come back later.
- Deleted all partitions from destination (250 GB) drive.
- Copied and pasted data partition from source disk to destination disk. Applied changes.
- Created extended partition on destination. Just a little
bigger than actual swap partition and aligned it to right.
- Moved swap from source to destination, into extended that partition, again
with right alignment.
- Shrinked extended partition to fully contain swap, without empty space. Applied changes.
- Than enlarged main data partition from 100 GB to contain empty space of the disk.
So, basically, I just moved all partitions from drive to drive.
But then came problems with Master Boot Sector. Gparted didn't copy them. So:
- I found the original disk from which I installed this Debian 6 version and reloaded from it into rescue mode. At this point I already disconnected source hard drive. So when I loaded rescue mode, there was only destination disk present.
- There was an option of MBR repair. Entered into it.
- Assigned data partition as a root partition and then selected "repair" (or similar) option.