Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need tips/guide for replacing HDD based rootfs with 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
dufeu
l33t
l33t


Joined: 30 Aug 2002
Posts: 896
Location: US-FL-EST

PostPosted: Thu Sep 17, 2015 7:24 pm    Post subject: Need tips/guide for replacing HDD based rootfs with SSD Reply with quote

Mods: I'm not sure where to put this but I thought it best fit in "Installing Gentoo" because it feels like a Gentoo re-install or upgrade. Please move if you feel it fits a different forum better.

I just recently built a new Gentoo based system. Since it's completion {though with emerge @world - no Gentoo system is ever 'finished' ;) } I've since decided that I would like to make my boot drive and rootfs SSD based.

This is what the current boot/rootfs HDD looks like:
Code:
(Model: ATA HGST HDN724030AL (scsi)
Disk /dev/sdg: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name      Flags
 1      1049kB  3146kB  2097kB                  grub      bios_grub
 2      3146kB  137MB   134MB   ext4            boot
 3      137MB   17.1GB  17.0GB  linux-swap(v1)  swap
 4      17.1GB  18.0GB  910MB   ext4            sysrescd
 5      18.0GB  3001GB  2983GB  btrfs           rootfs

This is what the SSD liiks like:
Code:
Model: ATA Samsung SSD 850 (scsi)                                         
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags

My original thoughts were to use something like 'dd_rescue' or possibly 'gparted' to duplicate the partition structure but leave the last partition blank on the SSD. I'd then want to 'possibly rsync?' the various system directories onto the 5th SSD partition and so on.

I stopped when I realized that I haven't any clue as to how well this will play with 'gpt' partition table nor do I recall how to truncated a partition which is truncated into a smaller space.

I since been looking for some kind of guide to replacing one's boot HHD with a boot SSD and really haven't found anything beyond doing a full re-install from scratch. This reall isn't what I want to do.

Does anyone have any tips or know of any quides which might be available? After googling for awhile, I can't seem to think of appropriate search terms because I've found nothing useful.

I have plenty of space for making/copying/mounting partition images if needed as part of the process.
_________________
People whom think M$ is mediocre, don't know the half of it.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7132
Location: almost Mile High in the USA

PostPosted: Thu Sep 17, 2015 10:54 pm    Post subject: Reply with quote

I really think there's nothing to it. Just copy it somehow. If you have identical partition sizes and dd it, it will just work. If you have different sizes, you can mkfs the new space and just copy everything as is (but make sure hard links are preserved.)

The bootloader is the only thing that will have problems, you'll have to install it again manually; unless if you're using EFI. EFI has it easy. Don't have to do anything if your ESP is flagged properly and you copied the images into the right path.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Fri Sep 18, 2015 5:44 am    Post subject: Re: Need tips/guide for replacing HDD based rootfs with SSD Reply with quote

dufeu wrote:
Does anyone have any tips or know of any quides which might be available? After googling for awhile, I can't seem to think of appropriate search terms because I've found nothing useful.

OT, I know, but you might want to consider the Live-migration of your data section from http://www.sysresccd.org/Sysresccd-LVM-EN-Overview-of-the-logical-volume-manager#Reasons_to_use_LVM although it wouldn't help you this time.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Sep 18, 2015 4:29 pm    Post subject: Reply with quote

dufeu,

Code:
Model: ATA Samsung SSD 850 (scsi)                                         
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Thats odd. 512B physical sectors. Even memory sticks are 4k but lie about it.

You might consider using LVM to make best use of the 250G
Use ext4 everywhere but turn off the journal on filesystems you can afford to throw away and recreate.
For example, /boot, /tmp, if its on HDD. /usr/portage, /usr/portage/distfiles but not /usr/portage/packages.
Put /var/tmp/portage into tmpfs to avoid writes to your SSD.

/usr/portage will want 4G with the default 4k block size, just for the portage tree.
If you use a 1k block size for /usr/portage, it less than half a gig.
Code:
Filesystem                1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg-portage      2046355    436466   1505032  23% /usr/portage
thats just the tree.
If you want to squash it even further, there is portage in squashfs.

If you adopt LVM, only allocate the space you need. Growing a filesystem when you fill it up is trival.
Its two commands and you don't even stop your PC. Shrinking a filesystem, so you can allocate space elsewhere is much harder.

Code:
$ sudo /sbin/pvdisplay
  --- Physical volume ---
  PV Name               /dev/sde2
  VG Name               static
  PV Size               476.82 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              122065
  Free PE               109521
  Allocated PE          12544
  PV UUID               cFoZJl-1URB-JTGu-05Df-eJ0R-nJYE-45AqZb

so only 10% oy my SSD is allocated.
/home is still on rotating rust, as is all of my /usr/portage.
_________________
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
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