Moving Debian to another hd AND changing partitions

If none of the more specific forums is the right place to ask

Moving Debian to another hd AND changing partitions

Postby bryanmc » 2017-12-24 00:34

I'm planning to move my stretch install to another (new) hd. Currently / is sda2 and /home is sda5. Sda1 is a win7 partition, which will not be reused as I'm going to run win7 in vbox when I need it for anything. I've done some research and found out that I can modify my clonezilla image files for these partitions to change them so they will restore to sda1 and sda2. My plan is to install the new hd, create sda1 and sda2 with gparted, set the boot flag on sda1 then reboot starting clonezilla and restore the partitions from the images. What step(s) am I overlooking in this plan? I know I've overlooked something.
bryanmc
 
Posts: 81
Joined: 2016-11-18 12:21


Re: Moving Debian to another hd AND changing partitions

Postby bryanmc » 2017-12-24 02:08

Thanks for the link. Evidently I didn't have the correct terms in my search, but that thread was so recent I must have missed it. So is it safe to assume that nothing in the system will bork because it it's mover to a different partition as long as the uuid or label is the same? I didn't see that addressed in the thread.
bryanmc
 
Posts: 81
Joined: 2016-11-18 12:21

Re: Moving Debian to another hd AND changing partitions

Postby steve_v » 2017-12-24 02:31

I have done this many times, it goes something like this:
Create new backup (in my case rsync, though pretty much anything works).
Restore backup to new drive.
Chroot into new drives' /, set new UUIDS (I tend to use labels on small systems though), reinstall grub.
Pull old drive.
Reinstall old drive and repeat from (3) because I forgot to mount /boot in the chroot.

OTOH, if you have a full disk image that preserves partition UUIDS (IIRC clonezilla does), just restore the image and use e.g. (g)parted to resize things.
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Moving Debian to another hd AND changing partitions

Postby p.H » 2017-12-24 09:05

bryanmc wrote:So is it safe to assume that nothing in the system will bork because it it's mover to a different partition as long as the uuid or label is the same?

If GRUB was installed on the same disk as the partition containing /boot/grub, it records only the partition number, not the filesystem UUID. That is another reason to reinstall GRUB after the transfer.

steve_v wrote:OTOH, if you have a full disk image that preserves partition UUIDS (IIRC clonezilla does), just restore the image and use e.g. (g)parted to resize things.

That method is tedious because growing a partition which is not at the end of the disk requires to move all the subsequent partitions (and their contents, used or not) towards the end.
p.H
 
Posts: 645
Joined: 2017-09-17 07:12


Return to General Questions

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable