Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Moving Debian to another hd AND changing partitions

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
bryanmc
Posts: 122
Joined: 2016-11-18 12:21
Has thanked: 2 times

Moving Debian to another hd AND changing partitions

#1 Post by bryanmc »

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: 122
Joined: 2016-11-18 12:21
Has thanked: 2 times

Re: Moving Debian to another hd AND changing partitions

#3 Post by bryanmc »

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.

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1400
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 79 times
Been thanked: 175 times

Re: Moving Debian to another hd AND changing partitions

#4 Post by steve_v »

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.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Moving Debian to another hd AND changing partitions

#5 Post by p.H »

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.

Post Reply