Gentoo Archives: gentoo-user

From: Wol <antlists@××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] LVM and moving things around
Date: Sun, 27 Mar 2022 19:48:51
Message-Id: 6f74983a-a9bb-0ea4-6b30-7a010e463140@youngman.org.uk
In Reply to: [gentoo-user] LVM and moving things around by Dale
1 On 27/03/2022 20:17, Dale wrote:
2 > Howdy,
3 >
4 > I sort of started this on another thread but wanted to nail a few things
5 > down first.  I'm wanting to encrypt some parts of my data on /home.
6 > This is what I got hard drive wise.
7 >
8 >
9 > root@fireball / # pvs
10 >   PV         VG     Fmt  Attr PSize    PFree
11 >   /dev/sda7  OS     lvm2 a--  <124.46g 21.39g
12 >   /dev/sdb1  Home2  lvm2 a--    <5.46t     0
13 >   /dev/sdc1  Home2  lvm2 a--    <7.28t     0
14 >   /dev/sdd1  Home2  lvm2 a--    <7.28t     0
15 >   /dev/sde1  backup lvm2 a--   698.63g     0
16 > root@fireball / #
17 >
18 One big piece of missing information. What does fdisk say about
19 sd[b,c,d]1? And can you add sdf1?
20
21 I'm guessing you've got three 8TB drives? Or is it two 8s and a 6? Can
22 you get a third 8TB? And if you're encrypting *parts* of /home ... what
23 parts?
24 >
25 > I've done some checking on sizes of things I want to encrypt and am
26 > weighing options.  I use LVM which should help make things easier.  I've
27 > downloaded and printed some howtos regarding shrinking the file system
28 > and LVM thingys.  It seems I need to shrink the file system while my
29 > /home partition is unmounted.  Then move the data off whichever drive I
30 > want to remove and then remove the drive itself.  After that I can
31 > encrypt the just removed drive and start moving files over, using rsync
32 > is my plan.  I think that is the basic steps.
33
34 Not necessarily.
35 >
36 > My question now comes to this.  When I encrypt one of the drives, can I
37 > then expand that drive with it being encrypted or is that not a option?
38 > I plan to encrypt two of the drives as one volume group and leave one
39 > other volume group as normal.  I just want to be sure whether or not I
40 > can expand a encrypted LVM drive the same as a normal LVM since both
41 > uses LVM.  I use cryptsetup commands to accomplish the encryption if
42 > that matters.  So as a example, I start with one 7TB drive encrypted,
43 > move some data to it, then want to add either the 5TB or 7TB drive.  Can
44 > I just expand it like a normal LVM or does it being encrypted change
45 > things?
46 >
47 > Thoughts?  My remove steps look sensible?  Expanding encrypted LVM
48 > possible?
49
50 If you are using LVM to do the encryption, then I can't see any problems
51 adding a new PV to an encrypted VG.
52 >
53 > Dale
54 >
55 Personally, I'd use dm-crypt to encrypt the drive, and then the whole
56 lot is encrypted, and put plain LVM over that. I've got dedicated layers
57 for everything.
58
59 It looks like your home2 is 6TB+8TB+8TB. I'd get a new 8TB, put dm-crypt
60 on it, and add it. Now I can remove the first 8TB, dm-crypt it and
61 re-add it. Same with the second 8TB. Now remove the 6TB and there you
62 are ...
63
64 My layout's rather different from yours, so I don't think I ought to say
65 too much :-)
66
67 Cheers,
68 Wol

Replies

Subject Author
Re: [gentoo-user] LVM and moving things around Dale <rdalek1967@×××××.com>