• Re: [gentoo-user] LVM and moving things around

    From Wol@21:1/5 to Dale on Sun Mar 27 21:50:01 2022
    On 27/03/2022 20:17, Dale wrote:
    Howdy,

    I sort of started this on another thread but wanted to nail a few things
    down first.  I'm wanting to encrypt some parts of my data on /home.
    This is what I got hard drive wise.


    root@fireball / # pvs
      PV         VG     Fmt  Attr PSize    PFree
      /dev/sda7  OS     lvm2 a--  <124.46g 21.39g
      /dev/sdb1  Home2  lvm2 a--    <5.46t     0
      /dev/sdc1  Home2  lvm2 a--    <7.28t     0
      /dev/sdd1  Home2  lvm2 a--    <7.28t     0
      /dev/sde1  backup lvm2 a--   698.63g     0
    root@fireball / #

    One big piece of missing information. What does fdisk say about
    sd[b,c,d]1? And can you add sdf1?

    I'm guessing you've got three 8TB drives? Or is it two 8s and a 6? Can
    you get a third 8TB? And if you're encrypting *parts* of /home ... what
    parts?

    I've done some checking on sizes of things I want to encrypt and am
    weighing options.  I use LVM which should help make things easier.  I've downloaded and printed some howtos regarding shrinking the file system
    and LVM thingys.  It seems I need to shrink the file system while my
    /home partition is unmounted.  Then move the data off whichever drive I
    want to remove and then remove the drive itself.  After that I can
    encrypt the just removed drive and start moving files over, using rsync
    is my plan.  I think that is the basic steps.

    Not necessarily.

    My question now comes to this.  When I encrypt one of the drives, can I
    then expand that drive with it being encrypted or is that not a option?
    I plan to encrypt two of the drives as one volume group and leave one
    other volume group as normal.  I just want to be sure whether or not I
    can expand a encrypted LVM drive the same as a normal LVM since both
    uses LVM.  I use cryptsetup commands to accomplish the encryption if
    that matters.  So as a example, I start with one 7TB drive encrypted,
    move some data to it, then want to add either the 5TB or 7TB drive.  Can
    I just expand it like a normal LVM or does it being encrypted change
    things?

    Thoughts?  My remove steps look sensible?  Expanding encrypted LVM possible?

    If you are using LVM to do the encryption, then I can't see any problems
    adding a new PV to an encrypted VG.

    Dale

    Personally, I'd use dm-crypt to encrypt the drive, and then the whole
    lot is encrypted, and put plain LVM over that. I've got dedicated layers
    for everything.

    It looks like your home2 is 6TB+8TB+8TB. I'd get a new 8TB, put dm-crypt
    on it, and add it. Now I can remove the first 8TB, dm-crypt it and
    re-add it. Same with the second 8TB. Now remove the 6TB and there you
    are ...

    My layout's rather different from yours, so I don't think I ought to say
    too much :-)

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to All on Sun Mar 27 21:20:01 2022
    Howdy,

    I sort of started this on another thread but wanted to nail a few things
    down first.  I'm wanting to encrypt some parts of my data on /home. 
    This is what I got hard drive wise.


    root@fireball / # pvs
      PV         VG     Fmt  Attr PSize    PFree
      /dev/sda7  OS     lvm2 a--  <124.46g 21.39g
      /dev/sdb1  Home2  lvm2 a--    <5.46t     0
      /dev/sdc1  Home2  lvm2 a--    <7.28t     0
      /dev/sdd1  Home2  lvm2 a--    <7.28t     0
      /dev/sde1  backup lvm2 a--   698.63g     0
    root@fireball / #


    I've done some checking on sizes of things I want to encrypt and am
    weighing options.  I use LVM which should help make things easier.  I've downloaded and printed some howtos regarding shrinking the file system
    and LVM thingys.  It seems I need to shrink the file system while my
    /home partition is unmounted.  Then move the data off whichever drive I
    want to remove and then remove the drive itself.  After that I can
    encrypt the just removed drive and start moving files over, using rsync
    is my plan.  I think that is the basic steps.

    My question now comes to this.  When I encrypt one of the drives, can I
    then expand that drive with it being encrypted or is that not a option? 
    I plan to encrypt two of the drives as one volume group and leave one
    other volume group as normal.  I just want to be sure whether or not I
    can expand a encrypted LVM drive the same as a normal LVM since both
    uses LVM.  I use cryptsetup commands to accomplish the encryption if
    that matters.  So as a example, I start with one 7TB drive encrypted,
    move some data to it, then want to add either the 5TB or 7TB drive.  Can
    I just expand it like a normal LVM or does it being encrypted change
    things? 

    Thoughts?  My remove steps look sensible?  Expanding encrypted LVM
    possible?

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wol@21:1/5 to Dale on Sun Mar 27 22:40:01 2022
    On 27/03/2022 21:13, Dale wrote:
    Wol wrote:
    On 27/03/2022 20:17, Dale wrote:
    Howdy,

    I sort of started this on another thread but wanted to nail a few things >>> down first.  I'm wanting to encrypt some parts of my data on /home.
    This is what I got hard drive wise.


    root@fireball / # pvs
       PV         VG     Fmt  Attr PSize    PFree
       /dev/sda7  OS     lvm2 a--  <124.46g 21.39g
       /dev/sdb1  Home2  lvm2 a--    <5.46t     0
       /dev/sdc1  Home2  lvm2 a--    <7.28t     0
       /dev/sdd1  Home2  lvm2 a--    <7.28t     0
       /dev/sde1  backup lvm2 a--   698.63g     0
    root@fireball / #

    One big piece of missing information. What does fdisk say about
    sd[b,c,d]1? And can you add sdf1?

    I have the entire drive as one large partition for each drive.  I could
    have done it as a whole device but I wanted partitions to give a hint
    that the drive is in use, if booted from other medium for example.

    I have enough extra space that I can remove either a 6TB or a 8TB
    drive.  Once that is done, I can start to encrypt and move data around.
    This is some additional info from df for /home:


    /dev/mapper/Home2-Home2     20T  8.7T   12T  45% /home


    If I remove a 8TB drive, I'd still have enough room for my data.  I
    could then rebuild /home starting with the 8TB drive just freed up.
    Then as I move data, I could expand them one at a time encrypting as I
    go.  I'd rather not have to buy a hard drive right now.  Tight budget
    given other things I got going on.  I do have backups, more than one in
    a couple important data spots.

    Do you need to shrink your fs first though?

    My three 3TB partitions are raided, and /dev/md/home is my PV. I've only allocated the space to LVs that they need, so I could probably shrink
    the PV and remove a drive without needing to mess about with my LVs at
    all. I get the impression you may have allocated all your space, not a
    good idea.

    My attitude is my data is backed up, expanding an LV/FS is low risk,
    I'll just grow stuff as I need to ... my /home partition contains proper
    home drives, things like videos may be in /home/videos, but they're
    actually a separate partition, etc etc.


    I'm guessing you've got three 8TB drives? Or is it two 8s and a 6? Can
    you get a third 8TB? And if you're encrypting *parts* of /home ...
    what parts?

    I've done some checking on sizes of things I want to encrypt and am
    weighing options.  I use LVM which should help make things easier.  I've >>> downloaded and printed some howtos regarding shrinking the file system
    and LVM thingys.  It seems I need to shrink the file system while my
    /home partition is unmounted.  Then move the data off whichever drive I >>> want to remove and then remove the drive itself.  After that I can
    encrypt the just removed drive and start moving files over, using rsync
    is my plan.  I think that is the basic steps.

    Not necessarily.

    My question now comes to this.  When I encrypt one of the drives, can I >>> then expand that drive with it being encrypted or is that not a option?
    I plan to encrypt two of the drives as one volume group and leave one
    other volume group as normal.  I just want to be sure whether or not I
    can expand a encrypted LVM drive the same as a normal LVM since both
    uses LVM.  I use cryptsetup commands to accomplish the encryption if
    that matters.  So as a example, I start with one 7TB drive encrypted,
    move some data to it, then want to add either the 5TB or 7TB drive.  Can >>> I just expand it like a normal LVM or does it being encrypted change
    things?

    Thoughts?  My remove steps look sensible?  Expanding encrypted LVM
    possible?

    If you are using LVM to do the encryption, then I can't see any
    problems adding a new PV to an encrypted VG.

    Dale

    Personally, I'd use dm-crypt to encrypt the drive, and then the whole
    lot is encrypted, and put plain LVM over that. I've got dedicated
    layers for everything.

    It looks like your home2 is 6TB+8TB+8TB. I'd get a new 8TB, put
    dm-crypt on it, and add it. Now I can remove the first 8TB, dm-crypt
    it and re-add it. Same with the second 8TB. Now remove the 6TB and
    there you are ...

    My layout's rather different from yours, so I don't think I ought to
    say too much :-)

    Cheers,
    Wol




    What is the advantage of dm-crypt over cryptsetup?  I've learned how to
    use cryptsetup with my external drive so was hoping to stick with what I already know.  Unless there is a advantage to dm-crypt.

    I don't know either. I'm just far more familiar with the dm/md layer
    because I run md-raid over dm-integrity. Hence dm-crypt.

    Is cryptsetup a layer in its own right, or part of lvm? I prefer the
    Unix "use several tools each of which does one thing well", other people
    prefer a swiss army knife like ZFS or btrfs. I don't know where
    cryptsetup lies on that spectrum, and I don't know your preferences on
    that spectrum.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Wol on Sun Mar 27 23:10:01 2022
    Wol wrote:
    On 27/03/2022 21:13, Dale wrote:
    Wol wrote:
    On 27/03/2022 20:17, Dale wrote:
    Howdy,

    I sort of started this on another thread but wanted to nail a few
    things
    down first.  I'm wanting to encrypt some parts of my data on /home.
    This is what I got hard drive wise.


    root@fireball / # pvs
        PV         VG     Fmt  Attr PSize    PFree
        /dev/sda7  OS     lvm2 a--  <124.46g 21.39g
        /dev/sdb1  Home2  lvm2 a--    <5.46t     0
        /dev/sdc1  Home2  lvm2 a--    <7.28t     0
        /dev/sdd1  Home2  lvm2 a--    <7.28t     0
        /dev/sde1  backup lvm2 a--   698.63g     0
    root@fireball / #

    One big piece of missing information. What does fdisk say about
    sd[b,c,d]1? And can you add sdf1?

    I have the entire drive as one large partition for each drive.  I could
    have done it as a whole device but I wanted partitions to give a hint
    that the drive is in use, if booted from other medium for example.

    I have enough extra space that I can remove either a 6TB or a 8TB
    drive.  Once that is done, I can start to encrypt and move data around.
    This is some additional info from df for /home:


    /dev/mapper/Home2-Home2     20T  8.7T   12T  45% /home


    If I remove a 8TB drive, I'd still have enough room for my data.  I
    could then rebuild /home starting with the 8TB drive just freed up.
    Then as I move data, I could expand them one at a time encrypting as I
    go.  I'd rather not have to buy a hard drive right now.  Tight budget
    given other things I got going on.  I do have backups, more than one in
    a couple important data spots.

    Do you need to shrink your fs first though?

    From my understanding of my google results, I need to unmount /home,
    shrink the file system, then I can remount /home, use pvmove to move
    data off whichever drive I want to take LVM off of, then pvremove the
    drive to make the drive available just like a new drive.  I can then use
    it to start building the LVM and it be encrypted.  As I remove other
    drives with the same method above, I can expand the encrypted drives. 
    I'm still trying to figure out whether to use the 6TB or 8TB drive in
    normal mode.  I think the 6TB would be large enough for the normal /home
    and let the encrypted be on the other drives. 


    My three 3TB partitions are raided, and /dev/md/home is my PV. I've
    only allocated the space to LVs that they need, so I could probably
    shrink the PV and remove a drive without needing to mess about with my
    LVs at all. I get the impression you may have allocated all your
    space, not a good idea.

    I did allocate all the space because at the time, I wasn't considering encrypting any of that data or dividing it up.  Things have changed and
    I want to move things around.  This is one of the good things about ext4
    and LVM.  They can shrink in size fairly easy.  Of course, backups are
    always a good idea. 


    My attitude is my data is backed up, expanding an LV/FS is low risk,
    I'll just grow stuff as I need to ... my /home partition contains
    proper home drives, things like videos may be in /home/videos, but
    they're actually a separate partition, etc etc.

    That's sort of what I'm going to do.  I'm going to divide things into
    sections with some encrypted and some not.




    I'm guessing you've got three 8TB drives? Or is it two 8s and a 6? Can
    you get a third 8TB? And if you're encrypting *parts* of /home ...
    what parts?

    I've done some checking on sizes of things I want to encrypt and am
    weighing options.  I use LVM which should help make things easier. 
    I've
    downloaded and printed some howtos regarding shrinking the file system >>>> and LVM thingys.  It seems I need to shrink the file system while my
    /home partition is unmounted.  Then move the data off whichever
    drive I
    want to remove and then remove the drive itself.  After that I can
    encrypt the just removed drive and start moving files over, using
    rsync
    is my plan.  I think that is the basic steps.

    Not necessarily.

    My question now comes to this.  When I encrypt one of the drives,
    can I
    then expand that drive with it being encrypted or is that not a
    option?
    I plan to encrypt two of the drives as one volume group and leave one
    other volume group as normal.  I just want to be sure whether or not I >>>> can expand a encrypted LVM drive the same as a normal LVM since both
    uses LVM.  I use cryptsetup commands to accomplish the encryption if
    that matters.  So as a example, I start with one 7TB drive encrypted, >>>> move some data to it, then want to add either the 5TB or 7TB
    drive.  Can
    I just expand it like a normal LVM or does it being encrypted change
    things?

    Thoughts?  My remove steps look sensible?  Expanding encrypted LVM
    possible?

    If you are using LVM to do the encryption, then I can't see any
    problems adding a new PV to an encrypted VG.

    Dale

    Personally, I'd use dm-crypt to encrypt the drive, and then the whole
    lot is encrypted, and put plain LVM over that. I've got dedicated
    layers for everything.

    It looks like your home2 is 6TB+8TB+8TB. I'd get a new 8TB, put
    dm-crypt on it, and add it. Now I can remove the first 8TB, dm-crypt
    it and re-add it. Same with the second 8TB. Now remove the 6TB and
    there you are ...

    My layout's rather different from yours, so I don't think I ought to
    say too much :-)

    Cheers,
    Wol




    What is the advantage of dm-crypt over cryptsetup?  I've learned how to
    use cryptsetup with my external drive so was hoping to stick with what I
    already know.  Unless there is a advantage to dm-crypt.

    I don't know either. I'm just far more familiar with the dm/md layer
    because I run md-raid over dm-integrity. Hence dm-crypt.

    Is cryptsetup a layer in its own right, or part of lvm? I prefer the
    Unix "use several tools each of which does one thing well", other
    people prefer a swiss army knife like ZFS or btrfs. I don't know where cryptsetup lies on that spectrum, and I don't know your preferences on
    that spectrum.

    Cheers,
    Wol




    Based on the reply from Rich, thanks for the info, cryptsetup is just a
    upper level of dm-crypt.  Basically, cryptsetup just has some user
    friendly bits added on top of it.  Security wise, should be secure
    either way. 

    The biggest thing, can I encrypt a LVM group and then expand it.  It
    seems I can.  I've found where google results say the same but some
    results are dated.  Things change.  Sometimes for the good, sometimes not. 

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Wol on Sun Mar 27 22:20:01 2022
    Wol wrote:
    On 27/03/2022 20:17, Dale wrote:
    Howdy,

    I sort of started this on another thread but wanted to nail a few things
    down first.  I'm wanting to encrypt some parts of my data on /home.
    This is what I got hard drive wise.


    root@fireball / # pvs
       PV         VG     Fmt  Attr PSize    PFree
       /dev/sda7  OS     lvm2 a--  <124.46g 21.39g
       /dev/sdb1  Home2  lvm2 a--    <5.46t     0
       /dev/sdc1  Home2  lvm2 a--    <7.28t     0
       /dev/sdd1  Home2  lvm2 a--    <7.28t     0
       /dev/sde1  backup lvm2 a--   698.63g     0
    root@fireball / #

    One big piece of missing information. What does fdisk say about
    sd[b,c,d]1? And can you add sdf1?

    I have the entire drive as one large partition for each drive.  I could
    have done it as a whole device but I wanted partitions to give a hint
    that the drive is in use, if booted from other medium for example. 

    I have enough extra space that I can remove either a 6TB or a 8TB
    drive.  Once that is done, I can start to encrypt and move data around. 
    This is some additional info from df for /home:


    /dev/mapper/Home2-Home2     20T  8.7T   12T  45% /home


    If I remove a 8TB drive, I'd still have enough room for my data.  I
    could then rebuild /home starting with the 8TB drive just freed up. 
    Then as I move data, I could expand them one at a time encrypting as I
    go.  I'd rather not have to buy a hard drive right now.  Tight budget
    given other things I got going on.  I do have backups, more than one in
    a couple important data spots. 



    I'm guessing you've got three 8TB drives? Or is it two 8s and a 6? Can
    you get a third 8TB? And if you're encrypting *parts* of /home ...
    what parts?

    I've done some checking on sizes of things I want to encrypt and am
    weighing options.  I use LVM which should help make things easier.  I've >> downloaded and printed some howtos regarding shrinking the file system
    and LVM thingys.  It seems I need to shrink the file system while my
    /home partition is unmounted.  Then move the data off whichever drive I
    want to remove and then remove the drive itself.  After that I can
    encrypt the just removed drive and start moving files over, using rsync
    is my plan.  I think that is the basic steps.

    Not necessarily.

    My question now comes to this.  When I encrypt one of the drives, can I
    then expand that drive with it being encrypted or is that not a option?
    I plan to encrypt two of the drives as one volume group and leave one
    other volume group as normal.  I just want to be sure whether or not I
    can expand a encrypted LVM drive the same as a normal LVM since both
    uses LVM.  I use cryptsetup commands to accomplish the encryption if
    that matters.  So as a example, I start with one 7TB drive encrypted,
    move some data to it, then want to add either the 5TB or 7TB drive.  Can
    I just expand it like a normal LVM or does it being encrypted change
    things?

    Thoughts?  My remove steps look sensible?  Expanding encrypted LVM
    possible?

    If you are using LVM to do the encryption, then I can't see any
    problems adding a new PV to an encrypted VG.

    Dale

    Personally, I'd use dm-crypt to encrypt the drive, and then the whole
    lot is encrypted, and put plain LVM over that. I've got dedicated
    layers for everything.

    It looks like your home2 is 6TB+8TB+8TB. I'd get a new 8TB, put
    dm-crypt on it, and add it. Now I can remove the first 8TB, dm-crypt
    it and re-add it. Same with the second 8TB. Now remove the 6TB and
    there you are ...

    My layout's rather different from yours, so I don't think I ought to
    say too much :-)

    Cheers,
    Wol




    What is the advantage of dm-crypt over cryptsetup?  I've learned how to
    use cryptsetup with my external drive so was hoping to stick with what I already know.  Unless there is a advantage to dm-crypt. 

    Thanks.

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to rdalek1967@gmail.com on Sun Mar 27 22:30:01 2022
    On Sun, Mar 27, 2022 at 4:13 PM Dale <rdalek1967@gmail.com> wrote:

    What is the advantage of dm-crypt over cryptsetup? I've learned how to
    use cryptsetup with my external drive so was hoping to stick with what I already know. Unless there is a advantage to dm-crypt.

    So, I suspect that terms are being used loosely here, but dm-crypt is
    a kernel block device encryption layer, and cryptsetup is just a
    userspace wrapper that sets up dm-crypt. I don't think cryptsetup
    works without dm-crypt, but you could of course use dm-crypt without cryptsetup.

    There is an on-disk standard called LUKS that cryptsetup typically
    uses. This stores metadata about the layout, fields to store session
    keys encrypted with a passphrase, space to store info like rekeying
    progress, and so on. The kernel dm-crypt will just want a cipher/key
    to use and a range of disk blocks to apply it to. With LUKS /
    cryptsetup you can do handy things like have a passphrase that goes
    through many rounds to yield the session key, or the ability to have
    multiple passphrases that work, or the ability to change the session
    key, or temporarily store the session key in the clear so that the
    drive can be used without a passphrase, and so on.

    99% of the time linux distros are using cryptsetup/LUKS to manage
    encryption. If you wanted to use dm-crypt directly you'd basically
    have to either re-implement your own version of LUKS, or memorize a
    128 bit AES key. Even if you intend to use a key file I'd still
    consider using LUKS just for the standardization and options.

    I'm guessing that 99% of the time if somebody is talking about
    dm-crypt, they really mean cryptsetup/LUKS+dm-crypt. (I think LUKS is
    the on-disk standard, and cryptsetup is an implementation of it all.)

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wol@21:1/5 to Wol on Sun Mar 27 23:10:01 2022
    On 27/03/2022 21:36, Wol wrote:
    I don't know either. I'm just far more familiar with the dm/md layer
    because I run md-raid over dm-integrity. Hence dm-crypt.

    Is cryptsetup a layer in its own right, or part of lvm? I prefer the
    Unix "use several tools each of which does one thing well", other people prefer a swiss army knife like ZFS or btrfs. I don't know where
    cryptsetup lies on that spectrum, and I don't know your preferences on
    that spectrum.

    Just seen Rich's message, so now I know :-)

    But it's just hit me - you have three PV's joined into one LV? Is that effectively raid-0? If so, you know you have just TREBLED your risk of
    losing your home drive? (Although I do know the risk is low to start with.)

    Don't know what really to suggest though, other than getting a new 8TB
    drive and converting it to a 3x8TB 16TB raid-5 ... and you said you
    didn't want to splash out on a new drive ...

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Wol on Sun Mar 27 23:40:01 2022
    Wol wrote:
    On 27/03/2022 21:36, Wol wrote:
    I don't know either. I'm just far more familiar with the dm/md layer
    because I run md-raid over dm-integrity. Hence dm-crypt.

    Is cryptsetup a layer in its own right, or part of lvm? I prefer the
    Unix "use several tools each of which does one thing well", other
    people prefer a swiss army knife like ZFS or btrfs. I don't know
    where cryptsetup lies on that spectrum, and I don't know your
    preferences on that spectrum.

    Just seen Rich's message, so now I know :-)

    But it's just hit me - you have three PV's joined into one LV? Is that effectively raid-0? If so, you know you have just TREBLED your risk of
    losing your home drive? (Although I do know the risk is low to start
    with.)

    Don't know what really to suggest though, other than getting a new 8TB
    drive and converting it to a 3x8TB 16TB raid-5 ... and you said you
    didn't want to splash out on a new drive ...

    Cheers,
    Wol




    I don't have RAID at all.  Just three drives being used as /home on
    LVM.  I should use RAID but I have a backup that gets done each week.  I wouldn't lose much even if it crashed and burned badly.  The biggest
    loss might would be emails.  I think I have gmail set up to save them so
    I think it would download whatever was missing from the last backup restoration.  I need to check that. 

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sun Mar 27 23:32:53 2022
    On Sunday, 27 March 2022 22:04:45 BST Dale wrote:
    Wol wrote:
    My three 3TB partitions are raided, and /dev/md/home is my PV. I've
    only allocated the space to LVs that they need, so I could probably
    shrink the PV and remove a drive without needing to mess about with my
    LVs at all. I get the impression you may have allocated all your
    space, not a good idea.

    I did allocate all the space because at the time, I wasn't considering encrypting any of that data or dividing it up. Things have changed and
    I want to move things around. This is one of the good things about ext4
    and LVM. They can shrink in size fairly easy. Of course, backups are
    always a good idea.

    My attitude is my data is backed up, expanding an LV/FS is low risk,
    I'll just grow stuff as I need to ... my /home partition contains
    proper home drives, things like videos may be in /home/videos, but
    they're actually a separate partition, etc etc.

    That's sort of what I'm going to do. I'm going to divide things into sections with some encrypted and some not.

    I wonder if all you want to do is to encrypt some directories on your /home, then a different level of encryption would be more appropriate? Instead of encrypting a whole block device, you could just encrypt a directory tree or two, using ext4 encryption. e4crypt has been kicking around for a few years now and it is meant to be an improvement on eCryptfs.

    https://lwn.net/Articles/639427/

    https://wiki.gentoo.org/wiki/Ext4_encryption

    WARNING: I'm not qualified to speak about this topic because my experience is limited, but I'm interested all the same in reading your approach and other contributors advice.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmJA5hUACgkQseqq9sKV ZxmCOw/5AYBYuh1F88xGAIwhLvtGRBFhWVNs7dGQG+QJrRcbZEL68IA4W50SGiW3 hPFq8VdDxEgA1lCw2OugtYSizDxtVNfXpg8qxUVE6P9XF/EHZ0IWozYisIqUXvS7 6vPO9K4J36AnLByfYAH48Ny8QR3UdVCPxEaujCeJ+8o2yy/00mCm/hXVX0krxkCT e4JhNVTQliWmGCbLGkFyV3eQHgehiNmF45tIrUDshraUGRAIvNNLILTrIhNbQ7bo 09P8UWnvZUpasoStIk5tXkNOzzUYun0n0Euqe15QfkyP3quzjDX6W2VpACIgoKJA M/mu0Eqymf/Mo1Uh3acuO/HHzvtxtUjIm+uPbuMpGtUCjIRBGMk3skHW28sLm/UU QPiMssYx1/tjMwOUxH1N3ws8EN6LhVAf2vRdUgVP+bwSl4LlEbX8+BjTQ+OY1W5B IQBacDVv3279RR6bj4jpa+oT/2c1rhquzFM3mT/FPYsARcom/fSB8lvPWoF5RfUj XoL+vM+2C9B1M/XGhSE2SoktbcTI7gcnvNr+01MQYaEpZgxxFJoKykClJcaD6F16 YyVgUQgLMOdKZDlCV21Jv2LcWGLECIgGNUU9BcxfrbvlYQ1iEGpvXykdQ2KnbLH6 aOel2aUA8d4tm+88i2rfGFhruPhKW2RlpoWK1m6m8ZdjVa+WAPg=
    =k7mv
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Miles Rout@21:1/5 to Dale on Mon Mar 28 02:40:01 2022
    On Sun, Mar 27, 2022 at 04:04:45PM -0500, Dale wrote:
    Based on the reply from Rich, thanks for the info, cryptsetup is just a
    upper level of dm-crypt. Basically, cryptsetup just has some user
    friendly bits added on top of it. Security wise, should be secure
    either way.

    To be clear, cryptsetup is just a userspace command line tool for
    manipulating dm-crypt/LUKS stuff. dm-crypt is the kernel part. Lots of
    tools are structured this way. LVM is a thing in the kernel, and the lvcreate/pvcreate/etc. command line tools are just the userspace user interface. I assume they probably use a bunch of complicated ioctl()
    calls on the LVM block devices to do their magic.

    dm-crypt wraps an existing block device. What it wraps is typically a
    physical disk partition, but it does not have to be. It can wrap
    basically any block device.

    The 'device mapper' idea is a key part of what makes all these tools composable: they use block devices to implement other block devices,
    which can then be the 'inputs' to other such tools, etc. dm-crypt takes
    a block device and uses it to implement a new block device. Its key
    property is that (if you follow some basic rules) it is impossible
    without the key to obtain the data inside it just by looking at the
    underlying block device.

    LVM is similar, but it has a different purpose. It takes some set of underlying block devices (physical volumes) and it presents a different
    set of block devices (logical volumes) to you. Its key property is that
    it is a much more flexible way of arranging volumes (basically
    "partitioning") than the underlying MBR/GPT disk partitioning system.

    You can compose these things in multiple ways. You can use dm-crypt on
    its own. You can use LVM on its own. You can use dm-crypt on top of
    LVM (so you have physical disk partitions as physical volumes, then some
    or all of your logical volumes act as the underlying block devices for dm-crypt's purposes). Or you can use LVM on top of dm-crypt (so your
    LVM "physical" volumes are dm-crypt block devices).

    And of course at some point as the final layer you put filesystems on
    top of all of this.

    My personal setup, to give an example, is that on each physical disk I
    have a single partition. I use dm-crypt (with LUKS, which is basically 'dm-crypt but sane', more on that later) on those partitions. In other
    words, each physical disk in my computer has a single dm-crypt "volume".

    Each dm-crypt block device is then used as a physical volume for LVM.
    They are all in a volume group, and on top I have a number of logical
    volumes. Each logical volume then has ext4 on it.

    Here is what that looks like:

    NAME TYPE FSTYPE LABEL SIZE MOUNTPOINTS
    sda disk 3.6T
    `-sda1 part crypto_LUKS 3.6T
    `-hdd crypt LVM2_member 3.6T
    `-vg-videovol lvm ext4 VIDEO 100G /mnt/videos
    nvme0n1 disk 1.8T
    `-nvme0n1p1 part crypto_LUKS 1.8T
    `-root crypt LVM2_member 1.8T
    |-vg-rootvol lvm ext4 ROOT 100G /
    |-vg-swapvol lvm swap SWAP 64G [SWAP]
    |-vg-homevol lvm ext4 HOME 100G /home
    `-vg-audiovol lvm ext4 AUDIO 100G /mnt/audio

    The biggest thing, can I encrypt a LVM group and then expand it. It
    seems I can. I've found where google results say the same but some
    results are dated. Things change. Sometimes for the good, sometimes not.

    You can, but there is more than one way to do it, and you should be sure
    you're doing it in the best way for what you need.

    If you only want some of your LVM logical volumes to be encrypted, it
    would make most sense to use LUKS on top of LVM. That's the opposite of
    the way I show I have it set up above. That means you'd have disk
    partitions as LVM physical volumes and you'd put LUKS on top of the LVM
    logical volumes. The encryption (dm-crypt layer) would only be on some
    of your volumes. And it would be above the LVM layer. However, I'm not
    sure why you would want this.

    There are a million and one ways of laying stuff out. You could have a
    set of disks that are for encrypted stuff and a set of disks that are
    not. Then you could put all the encrypted disks together into an LVM volume group and put things you want encrypted in the logical volumes in your 'encrypted' volume group, while you put the things you don't want
    encrypted in the logical volumes in your 'unencrypted' volume group.

    I think you can even set things up so that logical volumes are fixed to
    a particular physical volume. Then you could have some of the physical
    volumes in your (single) volume group be encrypted, and others not, and
    assign logical volumes you want to be encrypted to the right physical
    volumes. But that seems very error-prone: I can definitely imagine you accidentally moving a meant-to-be-secret logical volume to the wrong pv
    and wham suddenly it's all being written out to disk in plaintext.

    Talking of plaintext, if you want to encrypt data you have on disks you
    should make sure that you _wipe the disks_ once you've moved that data
    off them. There's little value in the encryption if the original copies
    of the data are all still there on the drives in plaintext. You can use
    hdparm to securely wipe the drives. If it's a modern SSD it can
    probably do it instantly, because it actually stores the data on disk encrypted, and all it needs to do is wipe the key. If you have a hard
    drive then sadly you probably need to wait a long time for it to be
    wiped. It's going to take a hell of a long time for your system to
    overwrite every sector of an 8 TiB hard drive. This is another good
    reason for just encrypting everything yourself too: it makes it very
    easy to wipe your drives later: if you delete the key then it's all unrecoverable.

    The Arch linux wiki has a good overview of different ways of organising
    all of this, including the difference between plain dm-crypt and LUKS
    (just use LUKS), LVM on LUKS vs LUKS on LVM, encrypted boot, encrypted
    swap, etc. Most of what they say is pretty much directly applicable to
    Gentoo. The main difference is that they have their own very different
    way of doing initramfs setup, so you'll need to look at Gentoo-specific resources for that or work it out yourself.

    https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system#Overview

    https://wiki.gentoo.org/wiki/Dm-crypt_full_disk_encryption

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Michael on Mon Mar 28 06:00:01 2022
    Michael wrote:
    On Sunday, 27 March 2022 22:04:45 BST Dale wrote:

    That's sort of what I'm going to do. I'm going to divide things into
    sections with some encrypted and some not.
    I wonder if all you want to do is to encrypt some directories on your /home, then a different level of encryption would be more appropriate? Instead of encrypting a whole block device, you could just encrypt a directory tree or two, using ext4 encryption. e4crypt has been kicking around for a few years now and it is meant to be an improvement on eCryptfs.

    https://lwn.net/Articles/639427/

    https://wiki.gentoo.org/wiki/Ext4_encryption

    WARNING: I'm not qualified to speak about this topic because my experience is
    limited, but I'm interested all the same in reading your approach and other contributors advice.


    That is the basic plan.  I'll have /home as a normal open mount point. 
    That way I can login without a encryption password being needed.  After
    that, I plan to have other mount point(s) that are encrypted.  It may be /home/dale/Data or something to that effect.  I'm still doing some
    checking but the normal non-encrypted stuff should easily fit on a 6TB
    drive without encryption.  I can then rebuild the two 8TB drives as
    encrypted mount points with a different volume group thingy.  When I
    boot up, I can login in as usual then decrypt the other mount point and
    access it as needed or close it and it be encrypted until needed. 

    I've considered just encrypting /home completely but I don't have the
    option of closing it while I'm logged into KDE.  KDE wouldn't be able to access /home/dale/.kde or .config plus if I leave Seamonkey open, it
    will want to store new emails to .mozilla as well.  So, some things need
    to be available and I'm not to worried about them being encrypted
    anyway.  So encrypting all of /home would be overkill plus would be a
    problem for some things too, such as Seamonkey and KDE. 

    I'm looking at a hard drive purchase just to see if I can afford it
    money wise. 

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Dale on Mon Mar 28 08:20:01 2022
    On 27/03/2022 22:34, Dale wrote:
    I don't have RAID at all.  Just three drives being used as /home on
    LVM.  I should use RAID but I have a backup that gets done each week.  I wouldn't lose much even if it crashed and burned badly.  The biggest
    loss might would be emails.  I think I have gmail set up to save them so
    I think it would download whatever was missing from the last backup restoration.  I need to check that.

    You might have copies of email everywhere without realising it. If gmail
    is set up as imap, then it will keep a copy of all your mail. I have
    dovecot set up which keeps a copy of all mine.

    Suck it and see, but if you have /home on one drive, and dovecot cache
    on another, then you shouldn't lose anything. Mail clients should err on
    the side of caution, and if they disagree with the server they should
    assume the worst and sync keeping not sync deleting.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Wols Lists on Mon Mar 28 09:00:01 2022
    Wols Lists wrote:
    On 27/03/2022 22:34, Dale wrote:
    I don't have RAID at all.  Just three drives being used as /home on
    LVM.  I should use RAID but I have a backup that gets done each week.  I >> wouldn't lose much even if it crashed and burned badly.  The biggest
    loss might would be emails.  I think I have gmail set up to save them so
    I think it would download whatever was missing from the last backup
    restoration.  I need to check that.

    You might have copies of email everywhere without realising it. If
    gmail is set up as imap, then it will keep a copy of all your mail. I
    have dovecot set up which keeps a copy of all mine.

    Suck it and see, but if you have /home on one drive, and dovecot cache
    on another, then you shouldn't lose anything. Mail clients should err
    on the side of caution, and if they disagree with the server they
    should assume the worst and sync keeping not sync deleting.

    Cheers,
    Wol




    I looked into setting up a local mail server, it is just way over my
    head.  When I have time to deal with it, I'll look into it again.  I'm
    sure I can do it but at the moment, got to much else going on.  It's the season for catching catfish anyway.  ;-)

    I have Seamonkey set up as pop thingy.  It downloads the new messages
    and I looked to see, it is set not to delete from server for 90 days. 
    If I had a major loss, it would be far less than 90 days until I got
    back running. 

    May start moving things around tomorrow.  It can do some of the work
    while I'm catching catfish bait.  They love bream.  They fun to catch. 
    They give a good fight for a small fish. 

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Dale on Mon Mar 28 09:30:01 2022
    On 28/03/2022 07:53, Dale wrote:
    I looked into setting up a local mail server, it is just way over my
    head.  When I have time to deal with it, I'll look into it again.  I'm
    sure I can do it but at the moment, got to much else going on.  It's the season for catching catfish anyway.;-)

    If you look at dovecot, just make sure you look at the end of the .conf,
    where it points at a local config file. Then put all your changes in
    that local file.

    And I just use a filter in thunderbird to move all my mail from webmail
    to local dovecot, no faffing about with a proper mailserver. Okay, it's
    not a "proper" setup, but it's perfect for me ... :-)

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Michael on Mon Mar 28 15:00:02 2022
    Michael wrote:
    On Monday, 28 March 2022 04:59:04 BST Dale wrote:
    Michael wrote:
    On Sunday, 27 March 2022 22:04:45 BST Dale wrote:
    That's sort of what I'm going to do. I'm going to divide things into
    sections with some encrypted and some not.
    I wonder if all you want to do is to encrypt some directories on your
    /home, then a different level of encryption would be more appropriate?
    Instead of encrypting a whole block device, you could just encrypt a
    directory tree or two, using ext4 encryption. e4crypt has been kicking
    around for a few years now and it is meant to be an improvement on
    eCryptfs.

    https://lwn.net/Articles/639427/

    https://wiki.gentoo.org/wiki/Ext4_encryption

    WARNING: I'm not qualified to speak about this topic because my
    experience is limited, but I'm interested all the same in reading your
    approach and other contributors advice.
    That is the basic plan. I'll have /home as a normal open mount point.
    That way I can login without a encryption password being needed. After
    that, I plan to have other mount point(s) that are encrypted.
    OK, that's a different plan to what I'm talking about. I am talking about filesystem based encryption.

    You are talking about block device level encryption. Whether these other mountpoints you want to encrypt are for normal partitions, LVM, what-ever, you're dealing with whole block devices and mechanisms for encrypting these block devices *before* a filesystem and data is even placed on them.

    With a filesystem level encryption you will be using the kernel's native filesystem encryption and the fscrypt API to manage it. The sys-fs/fscrypt userspace package can be used to manage the kernel based fscrypt API to encrypt/decrypt some directories selectively within a filesystem. This can be
    set up to happen transparently via PAM, using the user's login, if desired.

    You can read more about the kernel fscrypt mechanism here:

    https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html

    For how to set it up and run it from userspace details are here:

    https://wiki.archlinux.org/title/Fscrypt


    It may be
    /home/dale/Data or something to that effect. I'm still doing some
    checking but the normal non-encrypted stuff should easily fit on a 6TB
    drive without encryption. I can then rebuild the two 8TB drives as
    encrypted mount points with a different volume group thingy. When I
    boot up, I can login in as usual then decrypt the other mount point and
    access it as needed or close it and it be encrypted until needed.
    If you have 8TB of data you want encrypted, then a block level encryption would make sense. However, if you only have a few MB or GB of data to encrypt
    in a couple of directories, then it may be more appropriate to consider native
    filesystem encryption with fscrypt.


    I've considered just encrypting /home completely but I don't have the
    option of closing it while I'm logged into KDE. KDE wouldn't be able to
    access /home/dale/.kde or .config plus if I leave Seamonkey open, it
    will want to store new emails to .mozilla as well. So, some things need
    to be available and I'm not to worried about them being encrypted
    anyway. So encrypting all of /home would be overkill plus would be a
    problem for some things too, such as Seamonkey and KDE.
    With fscrypt you can run manually 'fscrypt lock Vault-for-Dale' and only the directory 'Vault-for-Dale' with any files in it will be encrypted. All the remaining fs will be left as it was.

    Anyway, I'm only mentioning this as an alternative to consider, in case it fits
    your use case better than buying more disks and whole block device encryption methods.


    I do that with another tool on occasion.  Usually, it is a directory
    that has banking info etc in it.  I just right click and tell it to
    encrypt it.  It uses the same password as my encrypted email program. 
    The claim is it is secure. 

    Given the large sizes tho, doing this way seems best.  Even the tool I
    use for small stuff wouldn't work well. 

    I googled and was trying to find info on how long it will take to shrink
    from 20TB to around 12TBs or so.  It didn't lead to much except for
    someone with some seriously large drives and it taking about a week to shrink.  That's a problem.  If it will even take a few hours, I need a
    new plan.  Anyone have ideas on how long that will take?

    Dale

    :-)  :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Dale on Mon Mar 28 15:10:01 2022
    On 28/03/2022 13:52, Dale wrote:
    I googled and was trying to find info on how long it will take to shrink
    from 20TB to around 12TBs or so.  It didn't lead to much except for
    someone with some seriously large drives and it taking about a week to shrink.  That's a problem.  If it will even take a few hours, I need a
    new plan.  Anyone have ideas on how long that will take?

    Well, formatting my 3TB and 4TB drives I was looking at hours.
    dm-integrity I think it was a day or so.

    If you're shrinking 8TB off it, depends how much data it has to move
    around, but I'd allow at least a day, maybe more ...

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Mon Mar 28 13:10:45 2022
    On Monday, 28 March 2022 04:59:04 BST Dale wrote:
    Michael wrote:
    On Sunday, 27 March 2022 22:04:45 BST Dale wrote:
    That's sort of what I'm going to do. I'm going to divide things into
    sections with some encrypted and some not.

    I wonder if all you want to do is to encrypt some directories on your /home, then a different level of encryption would be more appropriate? Instead of encrypting a whole block device, you could just encrypt a directory tree or two, using ext4 encryption. e4crypt has been kicking around for a few years now and it is meant to be an improvement on eCryptfs.

    https://lwn.net/Articles/639427/

    https://wiki.gentoo.org/wiki/Ext4_encryption

    WARNING: I'm not qualified to speak about this topic because my
    experience is limited, but I'm interested all the same in reading your approach and other contributors advice.

    That is the basic plan. I'll have /home as a normal open mount point.
    That way I can login without a encryption password being needed. After
    that, I plan to have other mount point(s) that are encrypted.

    OK, that's a different plan to what I'm talking about. I am talking about filesystem based encryption.

    You are talking about block device level encryption. Whether these other mountpoints you want to encrypt are for normal partitions, LVM, what-ever, you're dealing with whole block devices and mechanisms for encrypting these block devices *before* a filesystem and data is even placed on them.

    With a filesystem level encryption you will be using the kernel's native filesystem encryption and the fscrypt API to manage it. The sys-fs/fscrypt userspace package can be used to manage the kernel based fscrypt API to encrypt/decrypt some directories selectively within a filesystem. This can be set up to happen transparently via PAM, using the user's login, if desired.

    You can read more about the kernel fscrypt mechanism here:

    https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html

    For how to set it up and run it from userspace details are here:

    https://wiki.archlinux.org/title/Fscrypt


    It may be
    /home/dale/Data or something to that effect. I'm still doing some
    checking but the normal non-encrypted stuff should easily fit on a 6TB
    drive without encryption. I can then rebuild the two 8TB drives as
    encrypted mount points with a different volume group thingy. When I
    boot up, I can login in as usual then decrypt the other mount point and access it as needed or close it and it be encrypted until needed.

    If you have 8TB of data you want encrypted, then a block level encryption
    would make sense. However, if you only have a few MB or GB of data to encrypt in a couple of directories, then it may be more appropriate to consider native filesystem encryption with fscrypt.


    I've considered just encrypting /home completely but I don't have the
    option of closing it while I'm logged into KDE. KDE wouldn't be able to access /home/dale/.kde or .config plus if I leave Seamonkey open, it
    will want to store new emails to .mozilla as well. So, some things need
    to be available and I'm not to worried about them being encrypted
    anyway. So encrypting all of /home would be overkill plus would be a
    problem for some things too, such as Seamonkey and KDE.

    With fscrypt you can run manually 'fscrypt lock Vault-for-Dale' and only the directory 'Vault-for-Dale' with any files in it will be encrypted. All the remaining fs will be left as it was.

    Anyway, I'm only mentioning this as an alternative to consider, in case it fits your use case better than buying more disks and whole block device encryption methods.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmJBpcUACgkQseqq9sKV Zxk4RA//UFlLgPOZScYdeqkH3NOn8jBtnSrGnWGupgnVxaQ7GR8Y54xNOVl2KggE z9LgTDGUTUXosSrgmDyp8SwycwjIsNDaQ0ug8W6bhNB+5BbAJKhsA55p4IRhdZbA wqP9jMM74vm5v2QLGAi4x4cNj618UlBhIjZHxR10SIe31yKqDixM/H6kCFwAftLq Fv/Zo1VrHHBsT1HEW+B35N1+qihhHc9cR+TXU2f6WODy0e7ZtrD/DT4vsGFF44ay hJJepGUAYXPEf4EXWxshJbrSdNGpyy7i3C3rnG5WJIHt1kHXsZBkro3KxyysZrYP Px8EjV4irgdbIt5YZ1YZXBDkn8RJWrTONJMeNHGgTVfkX8ECqr+70dp+eUy0m+wK XxkAHsAEqpfYPWeL7Yt7gd5DQa87fsMrTQBgWBBtmpsJR6bP0vdJBSNaSFK9fCZv 9YC2AflxyynOVoY/fDkgwNG+on0RR9kyfD8hU0xUYKaLh+BhAN1G2tOnovwypL2O kvBaWqywX4J0eoWnn4GYpjDYRlM27yDBHm4a48Z8RmDHMW5ZcDBbdefSfoWYOa8d 6WQ2AK7aa3y747QQuXWaoow9hCEEUGA4hMfR7K02AU4IdoKC+elOJqJXxTOOOX7V Tgoljy/XB+kUKDFyw+s53mm6waw0rzo6saS9Yp61y+MeVXD4+4g=
    =qfc/
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Wols Lists on Mon Mar 28 15:40:02 2022
    Wols Lists wrote:
    On 28/03/2022 13:52, Dale wrote:
    I googled and was trying to find info on how long it will take to shrink
    from 20TB to around 12TBs or so.  It didn't lead to much except for
    someone with some seriously large drives and it taking about a week to
    shrink.  That's a problem.  If it will even take a few hours, I need a
    new plan.  Anyone have ideas on how long that will take?

    Well, formatting my 3TB and 4TB drives I was looking at hours.
    dm-integrity I think it was a day or so.

    If you're shrinking 8TB off it, depends how much data it has to move
    around, but I'd allow at least a day, maybe more ...

    Cheers,
    Wol




    Time for plan B.  I expect a drive purchase soon.  $$$  Heck, it would
    be faster to do backups, redo the whole thing and copy it all back.  I
    could copy it in chunks.  First chunk gets me running and then copy
    remaining stuff.  Hmmmmm.

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to rdalek1967@gmail.com on Mon Mar 28 17:00:02 2022
    On Mon, Mar 28, 2022 at 9:32 AM Dale <rdalek1967@gmail.com> wrote:

    Time for plan B. I expect a drive purchase soon. $$$ Heck, it would
    be faster to do backups, redo the whole thing and copy it all back. I
    could copy it in chunks. First chunk gets me running and then copy
    remaining stuff. Hmmmmm.

    If you start having large volumes of data it probably makes sense to
    split that off and handle it differently. I am storing my large stuff
    on lizardfs for this reason (though if starting today I'd take another
    look at moosefs or ceph). When you don't care so much about IOPS, or efficiency of small files, there are a lot of constraints you can
    avoid with ext4. Distributed filesystems also have scaling benefits
    because you don't have to try to cram your 10 hard drives into a
    single host.

    Ext4 can be grown online, but it can't be shrunk online. When you
    start getting to large filesystems you need to consider
    backup/restoration time and if you want availability you really want
    solutions that feature RAID and which can do all the operations you
    need online. Simply having a backup might not be satisfactory if your
    backup requires dozens of hours to restore, except as a last resort.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to miles@rout.nz on Mon Mar 28 16:50:01 2022
    On Sun, Mar 27, 2022 at 8:32 PM Miles Rout <miles@rout.nz> wrote:

    To be clear, cryptsetup is just a userspace command line tool for manipulating dm-crypt/LUKS stuff. dm-crypt is the kernel part. Lots of tools are structured this way. LVM is a thing in the kernel, and the lvcreate/pvcreate/etc. command line tools are just the userspace user interface. I assume they probably use a bunch of complicated ioctl()
    calls on the LVM block devices to do their magic.

    So, LVM is actually 100% userspace, and is analogous to cryptsetup.

    The kernel implementation is just device mapper. It has a whole bunch
    of modules: https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/index.html

    Cryptsetup uses dm-crypt which take a block device and cipher
    parameters as input, and outputs a decrypted block device.

    LVM in its basic form uses dm-linear, which maps a range of blocks on
    an output device onto a range of blocks on an input device. You
    stitch a whole bunch of those together onto the same output device and
    you basically get logical volumes.

    LVM as the userspace component just stores all the metadata on disk to
    make it easy to use and keep you from scrambling your disks. It also
    uses other device mapper features like dm-raid/etc to do things like
    move data in while live, and so on.

    There actually have been other implementations of logical volumes on
    linux, but LVM is basically the standard these days.

    You can take two raw partitions and use dm-linear to turn them into
    one logical volume, with no metadata stored anywhere, and no need to
    install lvm.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Dale on Sat Apr 2 22:00:02 2022
    Dale wrote:
    Howdy,

    I sort of started this on another thread but wanted to nail a few things
    down first.  I'm wanting to encrypt some parts of my data on /home. 
    <<< SNIP >>>



    OK.  I looked into another hard drive but budget right now says no.  So,
    I went back to plan A.  I managed to remove the 6TB drive and it is now
    on it's own LVM thingy.  I've moved enough over to mount it and use it
    as my /home directory.  I'm in the process of copying other non-critical
    files over so I can move things around some more.  Anyway, I'm using
    rsync to copy things over.  It works great, can restart if I need to
    stop it etc etc but it has one thing that annoys me.  While it is
    copying things over, it makes my system slow to respond.  Once the cache
    in memory gets pretty full, it takes a while to switch desktops or for
    programs to show up when I do get to a desktop.  Seamonkey seems to be
    hit hardest with this.  I tried putting ionice in front of the command
    but it is still slow.  My CPU cores are a bit busy but nowhere near
    100%.  Most cores are switching from almost idle to around 40% at their peak.  If I added them all up, I'd say the total would average around
    10%, 20% at the very most.  I've got swapiness set pretty low and it
    isn't using swap according to gkrellm.

    Anyone have a idea how to make rsync not cause this problem?  Is there something besides ionice I need to use? 

    Thanks.

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Rich Freeman on Sat Apr 2 22:10:01 2022
    Rich Freeman wrote:
    On Mon, Mar 28, 2022 at 9:32 AM Dale <rdalek1967@gmail.com> wrote:
    Time for plan B. I expect a drive purchase soon. $$$ Heck, it would
    be faster to do backups, redo the whole thing and copy it all back. I
    could copy it in chunks. First chunk gets me running and then copy
    remaining stuff. Hmmmmm.
    If you start having large volumes of data it probably makes sense to
    split that off and handle it differently. I am storing my large stuff
    on lizardfs for this reason (though if starting today I'd take another
    look at moosefs or ceph). When you don't care so much about IOPS, or efficiency of small files, there are a lot of constraints you can
    avoid with ext4. Distributed filesystems also have scaling benefits
    because you don't have to try to cram your 10 hard drives into a
    single host.

    Ext4 can be grown online, but it can't be shrunk online. When you
    start getting to large filesystems you need to consider
    backup/restoration time and if you want availability you really want solutions that feature RAID and which can do all the operations you
    need online. Simply having a backup might not be satisfactory if your
    backup requires dozens of hours to restore, except as a last resort.


    That is one of the reasons I started using LVM.  At the time, the
    software you mention, except RAID, either wasn't wide spread or wasn't
    stable enough for general use.  One day, I just may switch to the new
    ways but I still have trouble remembering how to deal with LVM.  I may
    try to plan to buy two hard drives, maybe the price on 10TB drives will
    drop, so I can learn the new way.  Most of what I have are large files. 
    At least the things that I'm going to have on the new setup anyway. 

    My current plan, 6TB drive is a regular /home on LVM, already done. 
    Once I get space freed up, I'm going to remove one 8TB drive, reset LVM
    on it, add encryption, still trying to figure out the steps on that, and
    then add the 2nd 8TB drive to it.  I'll have 15TBs or so of space just
    for large files and it's encrypted.  It will mount somewhere within
    /home.  I'll just have to unlock and mount it manually.

    I'm getting there.  Trying to get rsync to cooperate at the moment.

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Kenworthy@21:1/5 to Dale on Sun Apr 3 03:20:01 2022
    ------MXAL0F37XUSKDVRGJGPR3IVODNN8WN
    Content-Type: text/plain;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    Rsync has a bwlimit argument which helps here. Note that rsync copies the whole file on what it considers local storage (which can be mounted network shares) ... this can cause a real slowdown.
    BillK


    On 3 April 2022 3:51:22 am AWST, Dale <rdalek1967@gmail.com> wrote:
    Dale wrote:
    Howdy,

    I sort of started this on another thread but wanted to nail a few things
    down first.  I'm wanting to encrypt some parts of my data on /home. 
    <<< SNIP >>>



    OK.  I looked into another hard drive but budget right now says no.  So,
    I went back to plan A.  I managed to remove the 6TB drive and it is now
    on it's own LVM thingy.  I've moved enough over to mount it and use it
    as my /home directory.  I'm in the process of copying other non-critical >files over so I can move things around some more.  Anyway, I'm using
    rsync to copy things over.  It works great, can restart if I need to
    stop it etc etc but it has one thing that annoys me.  While it is
    copying things over, it makes my system slow to respond.  Once the cache
    in memory gets pretty full, it takes a while to switch desktops or for >programs to show up when I do get to a desktop.  Seamonkey seems to be
    hit hardest with this.  I tried putting ionice in front of the command
    but it is still slow.  My CPU cores are a bit busy but nowhere near
    100%.  Most cores are switching from almost idle to around 40% at their >peak.  If I added them all up, I'd say the total would average around
    10%, 20% at the very most.  I've got swapiness set pretty low and it
    isn't using swap according to gkrellm.

    Anyone have a idea how to make rsync not cause this problem?  Is there >something besides ionice I need to use? 

    Thanks.

    Dale

    :-)  :-) 


    --
    Sent from my Android device with K-9 Mail. Please excuse my brevity. ------MXAL0F37XUSKDVRGJGPR3IVODNN8WN
    Content-Type: text/html;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <html><head></head><body>Rsync has a bwlimit argument which helps here. Note that rsync copies the whole file on what it considers local storage (which can be mounted network shares) ... this can cause a real slowdown.<br>BillK<br><br><br><div class="
    gmail_quote">On 3 April 2022 3:51:22 am AWST, Dale &lt;rdalek1967@gmail.com&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
    <pre dir="auto" class="k9mail">Dale wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Howdy,<br><br> I sort of started this on another thread but wanted to nail a few things<
    down first.&nbsp; I'm wanting to encrypt some parts of my data on /home.&nbsp;<br> &lt;&lt;&l
  • From Wols Lists@21:1/5 to Bill Kenworthy on Sun Apr 3 11:00:01 2022
    On 03/04/2022 02:15, Bill Kenworthy wrote:
    Rsync has a bwlimit argument which helps here. Note that rsync copies
    the whole file on what it considers local storage (which can be mounted network shares) ... this can cause a real slowdown.

    It won't help on the initial copy, but look at the - I think it is -
    --in-place option.

    It won't help with the "read and compare", but it only writes what has
    changed, so if a big file has changed slightly, it'll stop it re-copying
    the whole file.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wol@21:1/5 to Frank Steinmetzger on Sun Apr 3 18:10:01 2022
    On 03/04/2022 16:29, Frank Steinmetzger wrote:
    Am Sun, Apr 03, 2022 at 09:59:22AM +0100 schrieb Wols Lists:
    On 03/04/2022 02:15, Bill Kenworthy wrote:
    Rsync has a bwlimit argument which helps here. Note that rsync copies
    the whole file on what it considers local storage (which can be mounted
    network shares) ... this can cause a real slowdown.
    It won't help on the initial copy, but look at the - I think it is -
    --in-place option.

    This one is mostly useful if space on the destination is tight or the data link (for FS commands) is slooow, because normally rsync creates a new temp file and moves it into place once the transfer is complete. This to ensure you never lose data due to a broken connection. If space is tight you could also consider --delete-before instead, to first do all deletions before copying the new stuff.

    And making a temporary file may be exactly what you DON'T want. I make
    heavy use of hard links, and "make a temp file" absolutely buggers file
    system integrity ...

    And my use case with LVM and backups, "make a temp file" does both
    absolutely nothing to protect file system integrity, and makes every
    backup waste far more space than is necessary ...

    So --in-place actually has a lot of uses outside your two examples. I
    have oodles of space, and both my source and target are on fast sata
    links in the same computer, but not using --in-place would be *very*
    costly for me.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to antlists@youngman.org.uk on Sun Apr 3 17:30:01 2022
    On Sun, Apr 3, 2022 at 4:59 AM Wols Lists <antlists@youngman.org.uk> wrote:

    On 03/04/2022 02:15, Bill Kenworthy wrote:
    Rsync has a bwlimit argument which helps here. Note that rsync copies
    the whole file on what it considers local storage (which can be mounted network shares) ... this can cause a real slowdown.

    It won't help on the initial copy, but look at the - I think it is - --in-place option.

    It won't help with the "read and compare", but it only writes what has changed, so if a big file has changed slightly, it'll stop it re-copying
    the whole file.

    You might also try ionice - though I find that is hit and miss for effectiveness once you start adding layers like lvm/mdadm/etc as I
    don't know that the kernel actually sees all the downstream queues
    when it is throttling processes. I haven't used it on LVM in a while
    though.

    Replication performance (especially if you want to do a second pass
    with rsync) is the sort of thing that using pvmove/etc helps with -
    since it will ensure nothing gets moved. Snapshot-supporting
    filesystems like zfs/btrfs are also better if you want to sync things
    up because they can rapidly identify all the changes between two
    snapshots without having to actually read anything but metadata,
    assuming you manage things correctly and maintain a common baseline
    between them.

    Of course all of those options require that they be set up in advance.
    If you just have two generic filesystems and want to sync them, then
    rsync is your main option.

    Oh, one thing I would suggest is that if they're on different hosts
    you actually run rsyncd or do the sync over ssh so that rsync
    recognizes the situation and will run the client on the remote host,
    so that all the hashing/etc is run local to the drives. This greatly
    reduces your network traffic which is likely to be the bottleneck.
    All the same, if you want to actually use hashes to find differences
    and not just rely on size/mtime there is no getting around having to
    read all the data off the disk.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Steinmetzger@21:1/5 to All on Sun Apr 3 17:40:01 2022
    Am Sun, Apr 03, 2022 at 09:59:22AM +0100 schrieb Wols Lists:
    On 03/04/2022 02:15, Bill Kenworthy wrote:
    Rsync has a bwlimit argument which helps here. Note that rsync copies
    the whole file on what it considers local storage (which can be mounted network shares) ... this can cause a real slowdown.

    It won't help on the initial copy, but look at the - I think it is - --in-place option.

    This one is mostly useful if space on the destination is tight or the data
    link (for FS commands) is slooow, because normally rsync creates a new temp file and moves it into place once the transfer is complete. This to ensure
    you never lose data due to a broken connection. If space is tight you could also consider --delete-before instead, to first do all deletions before
    copying the new stuff.

    It won't help with the "read and compare", but it only writes what has changed, so if a big file has changed slightly, it'll stop it re-copying the whole file.

    I think you mean the -c (or --checksum) option, which causes rsync to read
    the source and destination file (if both exist) in order to determine
    whether the source has changed. In normal use cases, this should not be necessary, as the file’s metadata (timestamps, permissions, inode numbers) are enough for that.

    As long as you don’t use -c, rsync is very quick at finding changed files.

    My standard command is rsync -ai --delete, wich does what most people™ need (-a/--archive means to copy all time stamps, permissions and owner, and -i shows what rsync does and why it does it). In some special cases, I include
    -x to not cross file systems (like when archiving /), or -H for hard links.
    I don’t deliberately use extended attributes, for which -X is your friend.

    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.

    “Don’t put multiple statements on a single line unless you have something to hide.” – Linus Torvalds, Linux kernel coding style documentation

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmJJvWwACgkQizG+tUDU MMqvsBAAgHvdaLJC2JVfQ04PAijxkgsRtnWs7hpwQRmtmO9NxiZdL/o8VZTEpqWZ ceopjAX9NIEOjSeeiK5bORF2OtN8mrW2qFZ+pCUX+Jju9dH+Yd+gSVJe5X3TV3Pa UqwN2gTMG15FqYTjq2QLT6Y6QGSNE9mdYLGir3JSQ7AOBNPunJtAczy2rceQ1fgo kAUh7nrNDP/+CQOzWuWlhfY/Kkpx2Gf4/ncioYN7PCXvB+RxTtur6tLNe3FBqbDs AbBE82E7gA+82Bu4AZx6rJSHt6yow7zj0oqSZ9G+EWPCDfNA/6BZq3E+1R8Kt/3a GS2e6uZevfYRjO0v27WBgs7Zz4QeSGZaeVI5gY8VL4R8qby2yHCtwxfclccSaMYK k4CmtZ4oJ+jaeBPhpROXr964gln3bmqQGZSZ9IUoxBNTrVmBG7K7UpuhSxeSMvu6 RVE+6LfS9AGUh/kfPLaSXoH3NkGk5N3AJ7dJmTELZoNe13cXejTIAz9FgXUHEoxU afgmgzbZ8J3lTxVdRSeiDAyFhm0H2TunlvSHcwlTdn7oaWi5HiA4SWymx2A9Ys40 dzhKhAQQC7Ma9r/kJO4mvuIX6CkYb/IFPBt+UsYnNBBE4SsR6OZe/U
  • From Frank Steinmetzger@21:1/5 to All on Sun Apr 3 20:40:02 2022
    Am Sun, Apr 03, 2022 at 05:05:07PM +0100 schrieb Wol:

    Rsync has a bwlimit argument which helps here. Note that rsync copies the whole file on what it considers local storage (which can be mounted network shares) ... this can cause a real slowdown.
    It won't help on the initial copy, but look at the - I think it is - --in-place option.

    This one is mostly useful if space on the destination is tight or the data link (for FS commands) is slooow, because normally rsync creates a new temp file and moves it into place once the transfer is complete.

    And making a temporary file may be exactly what you DON'T want. I make heavy use of hard links,

    … which the -H option is for.

    and "make a temp file" absolutely buggers file system integrity ...

    Can you elaborate? A temp file is just like any other file. If you do
    in-place syncing, then it “buggers up” the original file instead of a temp.

    And my use case with LVM and backups, "make a temp file" does both
    absolutely nothing to protect file system integrity

    I was not actually talking about file *system* integrity, but that if you overwrite in-place and the connection is lost during transfer, you are left with an incomplete file. Hence you just lost data on the destination. The FS itself is not adversely affected by that, only the file.

    and makes every backup waste far more space than is necessary ...

    How so? If it’s a COW filesystem, I can understand it (insofar as if you do in-place, then the existing file is deleted first, which gives the FS more space for the new copy).

    So --in-place actually has a lot of uses outside your two examples. I have oodles of space, and both my source and target are on fast sata links in the same computer, but not using --in-place would be *very* costly for me.

    Well I admit I don’t know much outside of my realm of local disks with ext4, zfs and ssh. While I do run LVM on my laptop, it’s just so that I can have “partitions” on an otherwise fully encrypted block device. I never used any of its more fancy features.

    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.

    Grammar: the difference between knowing your shit and knowing you’re shit.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmJJ6WIACgkQizG+tUDU MMrQpBAAjBQ8d8pEPyFPzHMoB1+uJw+pBTyOV4GOlop/n1TWf3v3WAIXhv1q/JUB 8G2gi7wtLH0igc9ptFsqBSPlVTWaC7Qd4aR9Ib9mGxpOMkViM02DydFyi82GWsJJ /ICS/wihNl3OOLzYKUBX6Qd9VMEEi2ydYj08ll3lFVFnOHwUMZ7MrpJxGrwe6pPL WPWNl5Vei4EmSXnSApbtb9pq1z/mL+cFR/3qOAFYyhMV2pHgRjkXRsy1STc1iD68 L5LBM0O5xGmcZZMil5dPhi+0hluRD2Vtr6kXX7i3wANLJvGxkZIoYTa19EUzB7Kw r74xSfl5b2WllP3jn5Ln+W6c+5fXRTEsqXR+7hzY+pmGacJrNuJ8mr88R7d7Oj4x x0jH07cDKKrKmvtIxhZ/dH5kYrgqpMJwu0DgxTHqLFipi8w4i+/Jm2EkbpfQw3Em hI+PsRF5q+IuHGXdlcTpgno8Cj7tQxUCTRvLFR2Szr1jMxdKzT0KhqefaViIJVC1 s2XcJPaHzDSoVGI52KkDMxgF0Wo2/zSG1VrxbUA38ys9AzmwU07ChM1PSutw+I1v lYswPjke7HqFtADvl1iNHUpXELP8B3gLZpUUGrwchO/Oh2UjXtXU7DFByhQO6RlC i+9g8RKUUA3PQzwDSQLCgaB3s6VR33oKQXwCxOYOBRS6xVx+t1A=
    =/ykR
    -
  • From Wol@21:1/5 to Frank Steinmetzger on Sun Apr 3 21:40:01 2022
    On 03/04/2022 19:37, Frank Steinmetzger wrote:
    Am Sun, Apr 03, 2022 at 05:05:07PM +0100 schrieb Wol:

    Rsync has a bwlimit argument which helps here. Note that rsync copies >>>>> the whole file on what it considers local storage (which can be mounted >>>>> network shares) ... this can cause a real slowdown.
    It won't help on the initial copy, but look at the - I think it is -
    --in-place option.

    This one is mostly useful if space on the destination is tight or the data >>> link (for FS commands) is slooow, because normally rsync creates a new temp >>> file and moves it into place once the transfer is complete.

    And making a temporary file may be exactly what you DON'T want. I make heavy >> use of hard links,

    … which the -H option is for.

    and "make a temp file" absolutely buggers file system integrity ...

    Can you elaborate? A temp file is just like any other file. If you do in-place syncing, then it “buggers up” the original file instead of a temp.

    "Make a temp file" breaks hard links. My file system is full of them,
    and keeping track of hard links can easily bring a system to its knees
    (it brought a previous system of mine to its knees :-)


    And my use case with LVM and backups, "make a temp file" does both
    absolutely nothing to protect file system integrity

    I was not actually talking about file *system* integrity, but that if you overwrite in-place and the connection is lost during transfer, you are left with an incomplete file. Hence you just lost data on the destination. The FS itself is not adversely affected by that, only the file.

    If the link is lost (unlikely on my system where both drives are on the
    same system) you just start again ... and you haven't actually lost any
    data, you've just got a corrupt copy to recover.

    and makes every backup waste far more space than is necessary ...

    How so? If it’s a COW filesystem, I can understand it (insofar as if you do in-place, then the existing file is deleted first, which gives the FS more space for the new copy).

    An LVM snapshot *IS* a COW filesystem. And no, --in-place doesn't delete
    the original, it just overwrites the bits that have changed.

    So my backups, all the identical data is de-duplicated. I have two
    separate filesystems I can mount, each of which is a full backup, but
    they only take up disk space for "one and a bit".

    So --in-place actually has a lot of uses outside your two examples. I have >> oodles of space, and both my source and target are on fast sata links in the >> same computer, but not using --in-place would be *very* costly for me.

    Well I admit I don’t know much outside of my realm of local disks with ext4,
    zfs and ssh. While I do run LVM on my laptop, it’s just so that I can have “partitions” on an otherwise fully encrypted block device. I never used any
    of its more fancy features.

    Read up on it. Especially if you're running linux, snapshotting root is
    a very good idea. I always snapshot root on a friday evening then do my
    emerge, and while it's never happened, if it all goes pear-shaped I can
    mount my backup and go back to where I was. And if you're doing anything
    at all dangerous, snapshotting will protect your "pre" state.

    (I only know how to make a snapshot, I've never really investigated
    rolling back, but it's nice knowing it's an option :-)

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Bill Kenworthy on Mon Apr 4 14:50:01 2022
    Bill Kenworthy wrote:
    Rsync has a bwlimit argument which helps here. Note that rsync copies
    the whole file on what it considers local storage (which can be
    mounted network shares) ... this can cause a real slowdown.
    BillK



    I ended up just letting it do its thing.  I didn't want to slow it down
    by much, just make my desktop able to respond better.  I used nice and
    ionice to do this with emerge and it works great.  I just thought I was missing some option for that command that google didn't help with.  I
    went and helped my sis-n-law with some garden stuff.  That helped.  ;-)

    As it stands now, I've copied enough over to get a free 8TB drive.  I
    set up LUKS, which includes LVM, on the drive and am copying some more
    files onto the newly encrypted drive.  Once everything is transferred,
    I'll then see if I need the other drive added or not.  I may not at the moment.  Of course, once fiber internet gets here, that may change
    pretty soon. 

    If someone is really knowledgeable about LVM and LUKS and how to set up
    a encrypted hard drive, not a whole install but just a data drive, a
    howto for this would be really nice.  I had to use a LUKS howto and a
    LVM howto and sort of merge commands until I figured out how to get the
    two together.  Even tho I got it working, I'm still not real clear on
    how one part of it works.  I'm just not clear enough on it to write one myself.  A Gentoo wiki would be nice.  There's one for the two
    separately but not together.  One posted anywhere google can find it
    would be great tho.

    Now to find something to do while rsync copies over some 6TBs of files. 
    O_O

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Laurence Perkins on Tue Apr 5 01:40:02 2022
    Laurence Perkins wrote:
    -----Original Message-----
    From: Dale <rdalek1967@gmail.com>
    Sent: Monday, April 4, 2022 5:42 AM
    To: gentoo-user@lists.gentoo.org
    Subject: Re: [gentoo-user] LVM and moving things around

    Bill Kenworthy wrote:
    Rsync has a bwlimit argument which helps here. Note that rsync copies
    the whole file on what it considers local storage (which can be
    mounted network shares) ... this can cause a real slowdown.
    BillK


    I ended up just letting it do its thing. I didn't want to slow it down by much, just make my desktop able to respond better. I used nice and ionice to do this with emerge and it works great. I just thought I was missing some option for that command
    that google didn't help with. I went and helped my sis-n-law with some garden stuff. That helped. ;-)

    As it stands now, I've copied enough over to get a free 8TB drive. I set up LUKS, which includes LVM, on the drive and am copying some more files onto the newly encrypted drive. Once everything is transferred, I'll then see if I need the other drive
    added or not. I may not at the moment. Of course, once fiber internet gets here, that may change pretty soon.

    If someone is really knowledgeable about LVM and LUKS and how to set up a encrypted hard drive, not a whole install but just a data drive, a howto for this would be really nice. I had to use a LUKS howto and a LVM howto and sort of merge commands
    until I figured out how to get the two together. Even tho I got it working, I'm still not real clear on how one part of it works. I'm just not clear enough on it to write one myself. A Gentoo wiki would be nice. There's one for the two separately but
    not together. One posted anywhere google can find it would be great tho.

    Now to find something to do while rsync copies over some 6TBs of files. O_O >>
    Dale

    :-) :-)

    A little late to the party, but the other setting to look at when you're doing this kind of thing is "sysctl vm.dirty_ratio".
    Basically it's what percentage of the disk cache can be dirty before the system forces all IO operations to be synchronous.

    Setting it higher lets the system keep more data up-in-the-air while you're shuffling lots of stuff around. Of course, it also risks losing more if the system crashes in the middle of it all, so use it judiciously.

    Setting dirty_ratio dirty_background_ratio, and dirty_writeback_centisecs appropriately when doing things with large amounts of data can significantly improve system responsiveness and, with rotational drives, throughput.

    LMP


    What's interesting, when it was doing the copy that made me ask about
    this, it was bad slow.  It really hit anything KDE hard and Seamonkey
    too.  Switching desktops with the mouse, real slow.  If I used the F*
    keys, switched pretty fast. 

    Today I was copying some more files from the normal old drive to the now encrypted one.  It didn't slow anything down enough to matter and most
    of the time, I couldn't even tell it was so busy.  I have no idea what
    made the difference tho.  Maybe it was cosmic rays from Mars.  ROFL 

    One thing that annoys me, it trying to use swap.  I don't want to
    disable it because on occasion Firefox goes nuts and starting hogging
    memory really bad.  I have swappiness set to like 5 or something which
    means it shouldn't use it but when using rsync, it creeps some in.  When
    it does, that results in some slowness.  I have a little script thing
    that clears all that but still, I may set it to 3 or maybe 2 for a bit. 
    Me ponders the thought. 

    I'm making progress.  Feel sorry for those hard drives tho. ;-)

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Laurence Perkins on Tue Apr 5 17:20:01 2022
    On 05/04/2022 14:58, Laurence Perkins wrote:

    -----Original Message-----
    From: Dale <rdalek1967@gmail.com>
    Sent: Monday, April 4, 2022 4:37 PM
    To: gentoo-user@lists.gentoo.org
    Subject: Re: [gentoo-user] LVM and moving things around


    One thing that annoys me, it trying to use swap. I don't want to disable it because on occasion Firefox goes nuts and starting hogging memory really bad. I have swappiness set to like 5 or something which means it shouldn't use it but when using
    rsync, it creeps some in. When it does, that results in some slowness. I have a little script thing that clears all that but still, I may set it to 3 or maybe 2 for a bit. Me ponders the thought.

    I'm making progress. Feel sorry for those hard drives tho. ;-)

    Dale

    :-) :-)



    I'm told that you can use cgroups for dealing with that kind of thing such that, for example, only Firefox is allowed to be swapped. I haven't had time to dig into it, but it seems like a useful tool.

    Also, the compressed swap and zram swap devices with backing stores offer a fairly significant boost to the speed of swap so long as the data being swapped is compressible.

    I don't know how you take advantage of it, but linux by default caches
    disk i/o. You can tell it to "don't cache" and apparently it makes a
    major difference. Given that rsync reads once and then never uses it
    again, you don't want it cached.

    I guess that would improve things for you massively if you could use it.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to antlists@youngman.org.uk on Tue Apr 5 21:00:01 2022
    On Tue, Apr 5, 2022 at 11:10 AM Wols Lists <antlists@youngman.org.uk> wrote:

    I don't know how you take advantage of it, but linux by default caches
    disk i/o. You can tell it to "don't cache" and apparently it makes a
    major difference. Given that rsync reads once and then never uses it
    again, you don't want it cached.


    I suggest reading:
    man posix_fadvise
    https://insights.oetiker.ch/linux/fadvise/ http://rdiez.shoutwiki.com/wiki/The_Linux_Filesystem_Cache_is_Braindead https://lwn.net/Articles/806980/ https://bugzilla.samba.org/show_bug.cgi?id=9560

    There might be something more recent, but my overall impression is
    that this problem is less solved than it probably ought to be.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)