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

Re: Migrate an old debian to a new machine



On 12/23/2017 11:31 AM, Markus Grunwald wrote:
> Hello,
> 
> For 10 Years, I've been working with my trusted old T61 (still with
> "IBM" logo...). Now I'm waiting for a new T570.
> 
> The last migrations of my Debian installations were just dd'ing a full
> disk image from machine OLD to NEW and then resize the partitions with
> gparted (I hate new installations... something's lost every time.)
> 
> These migrations were always done on BIOS machines. I have almost no
> experience with UEFI. Now my question is: will this work with the new
> machine as well? Or do I have to do something else because of UEFI (or
> something else that's different on a modern T570)?
> 

Hi Markus,

I'll tell you what I do when I have to change my HDDs. I'm not sure that
what I do will be applicable to you because new HDD(s) and old have to
be connected to same computer. These are steps I usually do.

 - connect new disk to old computer and boot from your old disk
 - partition your new disk with your favorite program. I like cgdisk
from gdisk package and in case of UEFI don't forget to use GPT partition
table.
	 - in case of UEFI you have to create EFI boot partition. I don't
remember how big it should be but I make it 1GB which is large enough.
	- create other partition on new disk - /, /home, swap etc.
	- format newly created partitions. Filesystem types on new HDD don't
have to match to old. For example you can migrate old ext3 to new ext4,
XFS or whatever you want. EFI boot partition should be formatted with

	# mkfs.vfat -F 32 /dev/xxx

 - mount root partition (in /mnt folder for example) and copy files with
	# cp -dpRx / /mnt
	if you have other filesystems mount and copy files from them as well

 - connect your new disk to your new computer and disconnect old disks
 - boot with netinstall Debian ISO in rescue mode. We are going to
(re-)install and configure grub
 - mount your root partition and chroot into it
 - change /etc/fstab accordingly your new device names
 - mount your EFI boot partition in /boot/efi
 - install grub-efi-amd64 package
 - run following commands
	# modprobe efivars
	# grub-mkdevicemap
	# update-initramfs -u
	# grub-install /dev/sda
	# update-grub
 - unmount /boot/efi
 - exit from shell go to installer's menu
 - reboot the system and enjoy your new hardware.

HTH

Kind regards
Georgi


Reply to: