Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Upgrades: LVM to SSD migration
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
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1181
Location: Stuttgart, Germany

PostPosted: Tue Oct 11, 2016 2:26 pm    Post subject: Upgrades: LVM to SSD migration Reply with quote

I have a rather substantial hardware upgrade on its way, and I'd like some advice on how to manage it without drinking myself into a coma or setting myself or my computer on fire. To wit, I'm replacing the mobo/CPU/RAM on my system, but also -- more significantly -- adding three SSDs to get a performance and boot-time improvement. My present hard-drive setup is somewhat complex, so I'd like some advice as to how best to manage the transition.

Here's what I have presently:
Three HDs are partitioned exactly the same: 100MB for /boot (RAID1/mirrored across all three), 10GB for / (also RAID1), 2GB for <swap> (three independent partitions), and all the rest of the drive part of one big RAID6 array. This RAID6 array is further partitioned to contain the following LVM partitions:

/portage
/portage/distfiles
/usr
/var
/var/tmp/
/opt
/home
and nine partitions as storage partitions varying in size from 100GB to 1.5TB

When finished with the transition, I want the following:
/boot, /, <swap>, /portage, /portage/distfiles, /usr, /var, /var/tmp, and /opt (as well as all other system partitions) all on two of the SSDs, mirrored as a RAID1 array.
/home and all the storage partitions (save one) and its subdirectories expanded to fill the entire three HDs, which will now be a single partition in a RAID6 array
that one storage subdirectory on the last SSD

I have a total of 6 SATA ports on the new mobo, so I could conceivably have all six drives attached at the same time. How, then, do I go about migrating from one setup to the other? Is my proposed target the best solution, or is there a better way to use the (upgraded) hardware that I'll have? What is the best way to copy an entire partition's contents, preserving file attributes like access/modification time, etc.?

Thanks in advance for the help. Huzzah for pimped-out machines!

Cheers,

EE
ADDED: furthermore, if at all possible, I would like to encrypt the system as much as possible while I'm transitioning over. At least /, and possibly also the /home partitions, I would like to have protected with encryption, meaning that I'll have to wipe the partitions (probably one at a time) as I remove them from and re-add them to the arrays.
ADDED 2: furthermore, as /var and /usr are on an LVM, I presently boot using an initrd (kindly shepherded into functioning by Neddy Seagoon) to pre-mount and scan them before transitioning to "real" root. Since this will no longer be necessary, how do I transition back to *not* using the initrd to boot?
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Tue Oct 11, 2016 3:02 pm    Post subject: Reply with quote

Quote:
adding three SSDs to get a performance and boot-time improvement


You only need one SSD for that :lol:

Quote:

When finished with the transition, I want the following:
/boot, /, <swap>, /portage, /portage/distfiles, /usr, /var, /var/tmp, and /opt (as well as all other system partitions) all on two of the SSDs, mirrored as a RAID1 array.
/home and all the storage partitions (save one) and its subdirectories expanded to fill the entire three HDs, which will now be a single partition in a RAID6 array
that one storage subdirectory on the last SSD


No, no, no.

/home is on SSD. If you don't do this you spend a lot of moneys on SSD and still have HDD performance for all programs that have their config files, storage, etc. in /home.

HDD is only for big clunky stuff that does not benefit from SSD at all (your bluray rips).

You must have a looot of junk in your portage/distfiles if you manage to fill three SSDs with it. How much space do all your system partitions combined really need? Empty SSD is like free RAM... useless.

Everything you use often and should be fast: on to the SSD it goes.

Quote:

ADDED: furthermore, if at all possible, I would like to encrypt the system as much as possible while I'm transitioning over. At least /, and possibly also the /home partitions, I would like to have protected with encryption, meaning that I'll have to wipe the partitions (probably one at a time) as I remove them from and re-add them to the arrays.
ADDED 2: furthermore, as /var and /usr are on an LVM, I presently boot using an initrd (kindly shepherded into functioning by Neddy Seagoon) to pre-mount and scan them before transitioning to "real" root. Since this will no longer be necessary, how do I transition back to *not* using the initrd to boot?



You are adding encryption and LVM, and think you no longer need an initramfs to boot? You're living in a dream world, Neo.
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1181
Location: Stuttgart, Germany

PostPosted: Tue Oct 11, 2016 9:18 pm    Post subject: Reply with quote

Code:
 $ df
Filesystem               1K-blocks      Used Available Use% Mounted on
/dev/md126                 9481060   4201728   4791060  47% /
/dev/dm-0                 20511356  14217300   5245480  74% /usr
/dev/dm-5                  3997376   1316588   2471076  35% /var
tmpfs                       405624      3432    402192   1% /run
dev                          10240         4     10236   1% /dev
shm                        2028104    137460   1890644   7% /dev/shm
cgroup_root                  10240         0     10240   0% /sys/fs/cgroup
/dev/md1                     94451     48405     41170  55% /boot
/dev/mapper/vg-portage     2030995    531043   1395095  28% /usr/portage
/dev/mapper/vg-distfiles  15723760  10876152   4061176  73% /usr/portage/distfiles
/dev/mapper/vg-home       61796348  43013200  15637420  74% /home
/dev/mapper/vg-opt         3997376    894908   2892756  24% /opt
/dev/mapper/vg-tmp         4128448    256516   3662220   7% /tmp
/dev/mapper/vg-vartmp     10321208    678432   9118488   7% /var/tmp
none                       2028104         0   2028104   0% /run/user/0
none                       2028104         8   2028096   1% /run/user/1000
/dev/mapper/vg-carrier1  103081248  19793604  78044764  21% /home/elassus/carrier1
/dev/mapper/vg-carrier2  103081248  69861812  27976556  72% /home/elassus/carrier2
/dev/mapper/vg-carrier3  103081248  83151900  14686468  85% /home/elassus/carrier3
/dev/mapper/vg-carrier4  103081248  73513572  24324796  76% /home/elassus/carrier4
/dev/mapper/vg-carrier5  103081248  61911672  35926696  64% /home/elassus/carrier5
/dev/mapper/vg-carrier6  103081248  71816016  26022352  74% /home/elassus/carrier6
/dev/mapper/vg-carrier7  103081248  78196392  19641976  80% /home/elassus/carrier7
/dev/mapper/vg-carrier8  103081248  58891200  38947168  61% /home/elassus/carrier8
/dev/mapper/vg-carrier9  928779720 709994156 171599644  81% /home/elassus/carrier9

I want to consolidate all of the system partition (except /home and its subdirectories) onto the SSDs that are in the RAID1 array (that is, mirrored for security). I'd estimate roughly that those all take about 50GB of space, all told. The *storage* partitions, however -- all those "carrier" partitions -- are about 1.3TB all told; there's no way I'll fit all that on the SSDs I have. So the main /home partition might conceivably also reside on an SSD, but the rest will have to stay on the HDD. /carrier2, however, and some parts of /carrier6, are all games, which is why I wanted the third SSD: to move all of them over to SSD, since they're the only real thing that needs fast i/o from disk (everything else is, as you rightfully predict, media files).

Given this present layout, what's the best use of the three 250GB SSDs that are apparently arriving Friday?

Cheers,

EE
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Oct 12, 2016 5:44 am    Post subject: Reply with quote

I have not read the full post.

I have three SSDs which I switch as backup or system drives. 120GB SSDs or 128GB SSDs. 2 Drives on the shelf, one in use. Its a rotation cycle, the backup drive is than mounted in my notebook and the system drive is than put on the shelf.

I have hte distfiles on an ordinary HDD.

Boot is unencrypted as the handbook wants it with 128MB on the SSD
root is LVM / LUKS on the SSD. Last backup revealed that i moved 32GB of data for root.
Some older User data resides on the 1TB 2.5" HDD, becuase its hardly used and I am too lazy to sort it out. Its not backuped because its very old, not that important

Disk Wise: 128GB / 120GB SSD is enough for root including home without the distfiles for a desctop user with a minimalistic desctop like i3wm + custom scripts.

Code:
df -h |grep \/root
/dev/mapper/root  110G   31G   73G  30% /


I still wonder why guys needs 256GB / 512 GB SSD drives ...

---

Quote:
(that is, mirrored for security).


The topic about data redundancy, backups is too much discussed.

IMHO, use different brands, different models. And make backups

I have plextor, ADATA and Sandisk (western digital purchased sandisk recently)

Different age, different technology, different firmware.

I do not recommend buying three identical drives with the same firmware and hardware.
Samsung had for example firmware bugs (no commennt on Samsung "quality" ...)

--

Quote:
2GB for <swap>


I had before 8GB RAM and now 16GB RAM on a notebook with an ivybridge i7 cpu.

--

Quote:
What is the best way to copy an entire partition's contents, preserving file attributes like access/modification time, etc.?


I moved my installation from different hardware with pvmove. This installation is very old, the hardware isn't

When you want ot backup your hole data / move your data.

Boot up a livecd and use cp -ar (archive and recursive)
Any backup scripts are confusing, useless in my expierience. Good old creating partitions, cp -ar, adapting the bootlaoder because lvm has restrictions to not allow the same volume name to be mounted at the same time.
I never had swap in use or a need for it.

There is also a way for a snapshot with lvm, but too complicated, not worth when I can deal with a backup in less than 2 hours...

Even on a penryn box with 4Gb of RAM which I sold 1.5 years ago I never had a need for swap, except google-chrome. google chrome has a memory bug. it fails whatever ...

Ditch the swap. I am quite sure you have enough RAM in your box.
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