Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM
Date: Wed, 14 Sep 2022 11:10:35
Message-Id: CAGfcS_kUwMQfRmdsAJA7GcYsg589yeLxLFbcyO20tPrYFmMEAA@mail.gmail.com
In Reply to: Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM by Dale
1 On Wed, Sep 14, 2022 at 1:40 AM Dale <rdalek1967@×××××.com> wrote:
2 >
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
11 If you want to do operations on a DM volume, then it needs to exist,
12 which in the cryptsetup world means "open."
13
14 Most of the details of how to do an operation like moving around
15 encrypted volumes depends on the layers you're using (LUKS, LVM,
16 mdadm, whatever), and how they're stacked. If you're running LVM on
17 top of LUKS then you create new LUKS volumes and add them to LVM and
18 move stuff around. If you're running LUKS on top of LVM then you add
19 unencrypted volumes to LVM, extend the LV underlying LUKS, and then
20 resize the LUKS volume. Last comes resizing whatever filesystems are
21 on top if desired.
22
23 When you want to get advice around these kinds of operations it is
24 usually necessary to detail exactly how things are set up, because to
25 Linux they're just layers and you can stack them however you want. A
26 script that adds a hard drive to your setup will look different if
27 you're running mdadm on the bottom vs LUKS vs LVM and so on.
28
29 Plus if you do things in the wrong order there is actually a chance
30 that it will work and leave you with half your filesystem on an
31 encrypted drive and half of it on an unencrypted one, or whatever. DM
32 doesn't care - it just shuffles around blocks and transforms them as
33 told, and as long as you stack things up the same way every time it
34 should still work. It just won't necessarily be doing what you want
35 it to...
36
37 --
38 Rich

Replies

Subject Author
Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM Dale <rdalek1967@×××××.com>