原來的系統硬碟怪怪的,又有not start from physical sectors問題。
怕重新開機後開不了,以及想用新的分割,網路找到最佳方案似乎是用
rsync做系統移動。使用的OS是fedora21,以下是操作過程。
#Issue: some original OS SSD partitions do not start from physical sectors
and encounter failing probability. This may comes from direct system backup
using clonezilla from 256G SSD to 500G SSD
# Original SSD has 3 primary partitions, 1 extended partition, 1 logical
partition. New goal is to eliminate sector alignment issue and to
re-partition SSD
#Step A: partition new Disk
#Step A.1: make disk label as msdos
parted /dev/sdX mklabel msdos # (it seems gpt partition cannot work as
bootable device)
#Step A.2: partition new disk with parted.
#(This step could also be done with fdisk)
parted /dev/sdX mkpart primary 1M 1G # creat /boot
parted /dev/sdX mkpart primary 1G 3G # creat swap
parted /dev/sdX mkpart primary 3G 99% # creat /
parted /dev/sdX mkpart primary 99% 100% # creat /home
#Step A.3: assign bootable partition
parted /dev/sdX set 1 boot on # make /dev/sdX1 bootable
Step A.4: format partitions and make swap
mkfs -t ext4 /dev/sdX1
mkswap /dev/sdX2
mkfs -t ext4 /dev/sdX3
mkfs -t ext4 /dev/sdX4
#Step B: Assign Old UUIDs into new Disk
#Step B.1: Show All UUIDs
blkid
#Step B.2: Update All UUIDs in new Disk
tunefs2 -U Old_bootPartion_UUID /dev/sdX1
mkswap -U Old_swapPartition_UUID /dev/sdX2
tunefs2 -U Old_rootPartition_UUID /dev/sdX3
tunefs2 -U Old_homePartition_UUID /dev/sdX4
#Step C:mount new Disk partions in /mnt
mount /dev/sdX3 /mnt
mount /dev/sdX1 /mnt/boot
mount /dev/sdX4 /mnt/home
#Step D:synchronize all system. Sometimes /boot must be
synchronize seperately
rsync -aAxHAX