Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM
Date: Wed, 14 Sep 2022 13:55:37
Message-Id: dcab1f11-d956-26a2-5c45-28ee392453ae@gmail.com
In Reply to: Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM by Rich Freeman
1 Rich Freeman wrote:
2 > On Wed, Sep 14, 2022 at 1:40 AM Dale <rdalek1967@×××××.com> wrote:
3 >> Now to replace my /home drive which is also close to full. It's not
4 >> encrypted tho. The biggest difference in this and plain LVM, resizing
5 >> with cryptsetup or close and reopen. Keep in mind, while I did all
6 >> this, LUKS, cryptsetup, whatever was open. I'm not sure about this
7 >> being done while closed. I did find one mention that it had to be open
8 >> at certain points.
9 >>
10 > If you want to do operations on a DM volume, then it needs to exist,
11 > which in the cryptsetup world means "open."
12 >
13 > Most of the details of how to do an operation like moving around
14 > encrypted volumes depends on the layers you're using (LUKS, LVM,
15 > mdadm, whatever), and how they're stacked. If you're running LVM on
16 > top of LUKS then you create new LUKS volumes and add them to LVM and
17 > move stuff around. If you're running LUKS on top of LVM then you add
18 > unencrypted volumes to LVM, extend the LV underlying LUKS, and then
19 > resize the LUKS volume. Last comes resizing whatever filesystems are
20 > on top if desired.
21 >
22 > When you want to get advice around these kinds of operations it is
23 > usually necessary to detail exactly how things are set up, because to
24 > Linux they're just layers and you can stack them however you want. A
25 > script that adds a hard drive to your setup will look different if
26 > you're running mdadm on the bottom vs LUKS vs LVM and so on.
27 >
28 > Plus if you do things in the wrong order there is actually a chance
29 > that it will work and leave you with half your filesystem on an
30 > encrypted drive and half of it on an unencrypted one, or whatever. DM
31 > doesn't care - it just shuffles around blocks and transforms them as
32 > told, and as long as you stack things up the same way every time it
33 > should still work. It just won't necessarily be doing what you want
34 > it to...
35 >
36
37
38 I see the point but wasn't aware there was more than one way to do it
39 with cryptsetup.  It seems there is several options for this.  I was
40 pretty sure LVM was on bottom and mentioned it in my original post. 
41 After reading your post, I got to wondering, did I do this the right
42 way?  So, I started looking to see how to tell for sure.  I used several
43 LVM type commands but didn't see anything that I recognized anyway. 
44 Keep in mind, I'm not real sure what I'm looking for either. Then I ran
45 lsblk -f and found a clue that I've never noticed before. 
46
47
48 sdd                                                                                                    
49
50 └─sdd1              LVM2_member LVM2 001         
51 pVnP2i-sj48-3co9-nJpa-9tQr-08pa-9JqASR               
52   └─crypt-crypt     crypto_LUKS 2                
53 6e884aae-9377-49ef-a602-e13cba89a377                 
54     └─crypt         ext4        1.0      crypt   
55 76653316-329f-4747-8fed-fc9b1723bd14      3.5T    79%
56 /home/dale/Desktop/Crypt
57
58
59 I know that is going to be line wrapped and mess up things but the part
60 I noticed was the drive partition "sdd1" and "LVM2 member".  On top of
61 that is crypto.  So, LVM is on bottom.  If that is the case, my pvmove
62 command should be moving what I think you call "raw data", doesn't
63 matter if it is encrypted or not, right?  Either way, other than
64 resizing the files system, I was dealing with LVM layers.  Just in case
65 it matters, could I have done everything but the file system resize
66 while it was closed?  It seems it is basically encrypted on the layer
67 just below the file system to me. 
68
69 Your post helped me to have a better idea of what I got here.  By all
70 means, point out if I got anything wrong.  Biggest thing, it seems to
71 have worked.  Still, I need more drive space.  :/
72
73 Thanks.
74
75 Dale
76
77 :-)  :-) 

Replies

Subject Author
Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM Frank Steinmetzger <Warp_7@×××.de>
Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM Wols Lists <antlists@××××××××××××.uk>