public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Dale <rdalek1967@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM
Date: Wed, 14 Sep 2022 08:55:26 -0500	[thread overview]
Message-ID: <dcab1f11-d956-26a2-5c45-28ee392453ae@gmail.com> (raw)
In-Reply-To: <CAGfcS_kUwMQfRmdsAJA7GcYsg589yeLxLFbcyO20tPrYFmMEAA@mail.gmail.com>

Rich Freeman wrote:
> On Wed, Sep 14, 2022 at 1:40 AM Dale <rdalek1967@gmail.com> wrote:
>> Now to replace my /home drive which is also close to full.  It's not
>> encrypted tho. The biggest difference in this and plain LVM, resizing
>> with cryptsetup or close and reopen.  Keep in mind, while I did all
>> this, LUKS, cryptsetup, whatever was open.  I'm not sure about this
>> being done while closed.  I did find one mention that it had to be open
>> at certain points.
>>
> If you want to do operations on a DM volume, then it needs to exist,
> which in the cryptsetup world means "open."
>
> Most of the details of how to do an operation like moving around
> encrypted volumes depends on the layers you're using (LUKS, LVM,
> mdadm, whatever), and how they're stacked.  If you're running LVM on
> top of LUKS then you create new LUKS volumes and add them to LVM and
> move stuff around.  If you're running LUKS on top of LVM then you add
> unencrypted volumes to LVM, extend the LV underlying LUKS, and then
> resize the LUKS volume.  Last comes resizing whatever filesystems are
> on top if desired.
>
> When you want to get advice around these kinds of operations it is
> usually necessary to detail exactly how things are set up, because to
> Linux they're just layers and you can stack them however you want.  A
> script that adds a hard drive to your setup will look different if
> you're running mdadm on the bottom vs LUKS vs LVM and so on.
>
> Plus if you do things in the wrong order there is actually a chance
> that it will work and leave you with half your filesystem on an
> encrypted drive and half of it on an unencrypted one, or whatever.  DM
> doesn't care - it just shuffles around blocks and transforms them as
> told, and as long as you stack things up the same way every time it
> should still work.  It just won't necessarily be doing what you want
> it to...
>


I see the point but wasn't aware there was more than one way to do it
with cryptsetup.  It seems there is several options for this.  I was
pretty sure LVM was on bottom and mentioned it in my original post. 
After reading your post, I got to wondering, did I do this the right
way?  So, I started looking to see how to tell for sure.  I used several
LVM type commands but didn't see anything that I recognized anyway. 
Keep in mind, I'm not real sure what I'm looking for either. Then I ran
lsblk -f and found a clue that I've never noticed before. 


sdd                                                                                                    

└─sdd1              LVM2_member LVM2 001         
pVnP2i-sj48-3co9-nJpa-9tQr-08pa-9JqASR               
  └─crypt-crypt     crypto_LUKS 2                
6e884aae-9377-49ef-a602-e13cba89a377                 
    └─crypt         ext4        1.0      crypt   
76653316-329f-4747-8fed-fc9b1723bd14      3.5T    79%
/home/dale/Desktop/Crypt


I know that is going to be line wrapped and mess up things but the part
I noticed was the drive partition "sdd1" and "LVM2 member".  On top of
that is crypto.  So, LVM is on bottom.  If that is the case, my pvmove
command should be moving what I think you call "raw data", doesn't
matter if it is encrypted or not, right?  Either way, other than
resizing the files system, I was dealing with LVM layers.  Just in case
it matters, could I have done everything but the file system resize
while it was closed?  It seems it is basically encrypted on the layer
just below the file system to me. 

Your post helped me to have a better idea of what I got here.  By all
means, point out if I got anything wrong.  Biggest thing, it seems to
have worked.  Still, I need more drive space.  :/

Thanks.

Dale

:-)  :-) 


  reply	other threads:[~2022-09-14 13:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  7:18 [gentoo-user] Replace 8TB drive with 10TB drive on encrypted LVM Dale
2022-09-14  5:40 ` Dale
2022-09-14 11:10   ` Rich Freeman
2022-09-14 13:55     ` Dale [this message]
2022-09-14 15:03       ` Frank Steinmetzger
2022-09-14 15:30         ` Dale
2022-09-14 16:37       ` Wols Lists
2022-09-14 12:50   ` Frank Steinmetzger
2022-09-14 15:35     ` Dale
2022-09-14 16:10   ` Laurence Perkins
2022-09-14 17:06     ` Dale
2022-09-14 17:11     ` Dale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dcab1f11-d956-26a2-5c45-28ee392453ae@gmail.com \
    --to=rdalek1967@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox