Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
move root file system from hdd to ssd
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
Jackie Lin
Tux's lil' helper
Tux's lil' helper


Joined: 31 May 2017
Posts: 115

PostPosted: Fri Mar 15, 2019 5:09 am    Post subject: move root file system from hdd to ssd Reply with quote

hello, there!
I want to buy an SSD。I have installed gentoo root directory on hdd.
how can I move the root file system from hdd to ssd without reinstalling gentoo on ssd again?
thanks a lot!
_________________
peace, focus.
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 513
Location: Inner Space

PostPosted: Fri Mar 15, 2019 9:45 am    Post subject: Re: move root file system from hdd to ssd Reply with quote

Jackie Lin wrote:
hello, there!
I want to buy an SSD。I have installed gentoo root directory on hdd.
how can I move the root file system from hdd to ssd without reinstalling gentoo on ssd again?
thanks a lot!

1. boot from systemrescuecd
2. mount both drives (you have to create the root partition on the ssd first)
3. cp -a /dev/sdaX /dev/sdbX (where a is the hdd and b is the ssd)

you still will need the hdd for booting as moving the root partition is not enough. probably you want also to copy the /boot partition and install the bootloader on the SSD.
_________________

Flux & Contemplation - Portrait of an Artist in Isolation

Back to top
View user's profile Send private message
vasettoo
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2012
Posts: 96

PostPosted: Fri Mar 15, 2019 3:40 pm    Post subject: Reply with quote

I successfully moved my whole gentoo installation from a smaller SSD to a bigger one on UEFI and gpt partition table with Clonezilla installed on bootable USB flash stick - cached into RAM after booting the clonezilla drive. Needed only to resize volume filesystems on the new drive as they are LVM.
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Fri Mar 15, 2019 4:27 pm    Post subject: Reply with quote

I think what @e3k wrote is mostly correct. For the 3rd step, I would prefer rsync over cp: rsync -avh /mnt/sdaX/ /mnt/sdbX (note the trailing / in the source directory)
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 434
Location: Stockholm

PostPosted: Fri Mar 15, 2019 8:47 pm    Post subject: Reply with quote

And correct entries like:
Code:
UUID=6bce835a-0910-434e-a610-576cc0c2fa54  /  ext4      noatime         0 1
in /etc/fstab or boot loader.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Mar 15, 2019 8:56 pm    Post subject: Reply with quote

ppurka wrote:
I think what @e3k wrote is mostly correct. For the 3rd step, I would prefer rsync over cp: rsync -avh /mnt/sdaX/ /mnt/sdbX (note the trailing / in the source directory)


What 3ek wrote is 100% correct. Everybody can check out 'man cp' and the -a option.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21431

PostPosted: Sat Mar 16, 2019 1:14 am    Post subject: Reply with quote

ppurka wrote:
For the 3rd step, I would prefer rsync over cp: rsync -avh /mnt/sdaX/ /mnt/sdbX (note the trailing / in the source directory)
I like rsync, but that invocation is not correct. You failed to preserve ACLs, hard links, and xattrs.
Back to top
View user's profile Send private message
Jackie Lin
Tux's lil' helper
Tux's lil' helper


Joined: 31 May 2017
Posts: 115

PostPosted: Sat Mar 16, 2019 4:45 am    Post subject: Re: move root file system from hdd to ssd Reply with quote

e3k wrote:
Jackie Lin wrote:
hello, there!
I want to buy an SSD。I have installed gentoo root directory on hdd.
how can I move the root file system from hdd to ssd without reinstalling gentoo on ssd again?
thanks a lot!

1. boot from systemrescuecd
2. mount both drives (you have to create the root partition on the ssd first)
3. cp -a /dev/sdaX /dev/sdbX (where a is the hdd and b is the ssd)

you still will need the hdd for booting as moving the root partition is not enough. probably you want also to copy the /boot partition and install the bootloader on the SSD.


Thanks, I think I have got the idea. I will have a try.
_________________
peace, focus.
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sat Mar 16, 2019 7:40 am    Post subject: Reply with quote

Jaglover wrote:
ppurka wrote:
I think what @e3k wrote is mostly correct. For the 3rd step, I would prefer rsync over cp: rsync -avh /mnt/sdaX/ /mnt/sdbX (note the trailing / in the source directory)


What 3ek wrote is 100% correct. Everybody can check out 'man cp' and the -a option.
Thanks! Something for me to learn as well.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
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