Re: Moving root partition to another drive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Got a bit of a problem  i need to move the root partition to another  drive  my
own fault  i did not make it big enough to start with but i cant face a
complete rebuild  of the system  i have several 1Tb drives lurking  but  how do
i switch things to a new drive  .
The easiest and safest way is to create a fresh partition of at least the same size on the new drive, create an empty file system, mount both file systems (old and new), and rsync data from old to new. Then unmount the new partition. From Live ISO of course. This way you do not need to care about partition size and also gain a bit of a cleanup in file system’s structures.

The alternative way is to simply invoke: `cp /dev/old_disk /dev/new_disk` (or `pv -ctrab /dev/old_disk >/dev/new_disk` if you care about the progress bar). Preferably followed by `blockdef --flushbufs /dev/new_disk` to minimize the risk of data not being synced to medium on system shutdown due to some error.⁽¹⁾ This will blindly copy *all* the partitions. The drawback is that — if the target drive is larger — the partition will not use all available space. You will have to resize both the partition and the file system afterwards, which is a more risky move. So the previous method is something I find better.

Finally, install the bootloader and adjust “/etc/fstab” to refer to the new partition (if needed).

____
⁽¹⁾ Very unlikely. But if that happens, you will not learn about it until it’s probably too late.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux