Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to move Gentoo to another Disk?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
iceamber
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2016
Posts: 87

PostPosted: Mon Nov 05, 2018 7:57 am    Post subject: how to move Gentoo to another Disk? Reply with quote

Hi, all
I want to change the disk of my computer to SSD, but I don't want to install Gentoo again, because config it will take a lot of time. How to do that?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Mon Nov 05, 2018 11:59 am    Post subject: Reply with quote

iceamber,

Clean out all the rubbish first.
eclean -d distfiles
eclean -d packages

Remove logs that you don't need
Remove the failed builds in /var/tmp/portage
emerge -c <old_kernel_sources>
...

There is no point in taking that with you.

Fit both drives to your system.
Boot with USB stick or something. You can't do this while your install is in use.
Partition the new drive to your liking. It need not be the same as the old one.
Make your filesystems.
Mount your new filesystem tree read/write at say /mnt/new
Mount your old filesystem tree read only at say /mnt/old
The readonly is important. It protects you if you mess up the copy.
Code:
cp -a  /mnt/old/*  /mnt/new/
I usually mess that up and get the output at the wrong level.

When that completes you have copied all your files over.

chroot into the new install
If you use BIOS, not UEFI, reinstall grub to the MBR
Fix your /etc/fstab.

You have things like your ssh host key and all your private keys on both drives.
Its up to you if that matters or not.
Don't give away your keys.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
iceamber
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2016
Posts: 87

PostPosted: Mon Nov 05, 2018 1:27 pm    Post subject: Reply with quote

NeddySeagoon wrote:
iceamber,

Clean out all the rubbish first.
eclean -d distfiles
eclean -d packages

Remove logs that you don't need
Remove the failed builds in /var/tmp/portage
emerge -c <old_kernel_sources>
...

There is no point in taking that with you.

Fit both drives to your system.
Boot with USB stick or something. You can't do this while your install is in use.
Partition the new drive to your liking. It need not be the same as the old one.
Make your filesystems.
Mount your new filesystem tree read/write at say /mnt/new
Mount your old filesystem tree read only at say /mnt/old
The readonly is important. It protects you if you mess up the copy.
Code:
cp -a  /mnt/old/*  /mnt/new/
I usually mess that up and get the output at the wrong level.

When that completes you have copied all your files over.

chroot into the new install
If you use BIOS, not UEFI, reinstall grub to the MBR
Fix your /etc/fstab.

You have things like your ssh host key and all your private keys on both drives.
Its up to you if that matters or not.
Don't give away your keys.


Thank you, I'll try it
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum