Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Unknown partition

  1. #11
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Unknown partition

    Code:
    $ lsblk -e 7 -o name,size,type,fstype,mountpoint
    NAME                    SIZE TYPE  FSTYPE      MOUNTPOINT
    sda                   465.8G disk              
    ├─sda1                  512M part  vfat        /boot/efi
    ├─sda2                  732M part  ext4        /boot
    └─sda3                464.6G part  crypto_LUKS 
      └─sda3_crypt        464.5G crypt LVM2_member 
        ├─vgubuntu-root   463.6G lvm   ext4        /
        └─vgubuntu-swap_1   980M lvm   ext4        
    sdb                   223.6G disk
    This is like a little picture, but in text.

    There are TWO HDD connected. sda and sdb. Those device names can change based on the boot and how quickly each is discovered. Never assume that sda is always sda between boots. ALWAYS CHECK.

    sda1 (partition) is the FAT32 (vfat) mandated partition required by UEFI standards.

    sda2 (partition) is the /boot ext4 partition. Any native Linux file system that the UEFI boot code supports can be used for this. Generally, ext2/ext3/ext4 are used. ext2 would be the lightest and since /boot isn't written very often and it is relatively small, the added features provided by ext3 and ext4 (journaled writes) don't really provide much added safety. /boot is mandatory for LVM and/or encrypted partitions in Ubuntu systems so the initramfs can be outside the more-complex-to-access LVM areas. Without LVM, /boot doesn't have to be a separate partition.

    /sda3 (partition) is where the LUKS container for encryption is placed. It uses the entire partition, but that isn't actually mandatory. Not using the entire partition doesn't make much sense. I can't think of any good reason why NOT to encrypt all of sda3.
    Inside that encrypted "container" (sda3_crypt), an LVM-PV has been setup. This is smart, since the entire sda3 is effectively part of LVM storage management, all encrypted, but can be modified. Here's an diagram I drew a few weeks ago to help explain:
    LVM-Diag.png
    Nothing too fancy, but the point is that LVs are inside VGs, and VGs, are inside PVs. What that diagram doesn't show is that VGs can be made of of any number of PVs from different storage devices and that LVs are also limited only be the available space inside a VGs. There are liabilities in using PVs on multiple disks, so unless you are going for redundancy, it is best to avoid that and just create a different PV, VG, LV setup for other disks. But, if you do want to have a RAID1 or RAID10 setup, LVM can do that. RAID1 can be created post-install. RAID10 has to be setup on all the disks at the same time. If your RAID skills aren't sufficient to understand why, best NOT to use RAID at all.
    Free VG space can be used for snapshots. Snapshots in enterprise tools are handy for many purposes. Generally, before backups, I'll create a snapshot to freeze the blocks to be backed up, mount that snapshot for the backup tool and run the backup on it. When completed, I remove the snapshot so those storage blocks aren't frozen any more.
    Creating a snapshot before patching would allow returning to that point in time nearly instantly should anything bad happen. Very handy. Again, I wouldn't keep that snapshot around too long, just long enough to ensure everything is fine - so a few days typically. Perhaps a week, if you patch weekly. I wouldn't keep 5 snapshots since it stops those blocks from being freed and holding that much storage could lead to an out of space problem much quicker that expected.

    vgubuntu-root is not really the LV name for the root LV. It is a mash of the VG name and the LV name. The same applies to vgubuntu-swap_1.
    To see how LVM has organized your storage, run these commands:
    Code:
    sudo pvs
    sudo vgs
    sudo lvs
    To see the different available commands for PVs, enter pv{tab}{tab} and the list of commands that start with "pv" will be shown. That's stuff to look at later, but pvmove might be a great time saver, right? Do the same for vg and lv commands. Generally, there are create, remove, change, resize, and display commands. vg and lv have extent, reduce, and rename commands. Out of storage and need to add more quickly? vgsplit could be useful. I'm not listing all the commands. Use apropos lvm to get a short description of each command.

    Anyways, this is about 20% of what LVM supports. You can thin-provision storage areas of you like. It can get complex quickly, but in the default Ubuntu setup, it really isn't too complex. We gain most of the LVM power without too many negatives, but we don't need to deal with the more complex capabilities unless we are ready for those. By just having LVM on a system, under the file systems, we gain much flexibility.

  2. #12
    Join Date
    Jul 2021
    Beans
    6

    Re: Unknown partition

    Okay, I understand better now. Thanks again. I will get to work in this the next few days.

  3. #13
    Join Date
    Mar 2007
    Beans
    1,116

    Re: Unknown partition

    I've been following this discussion but didn't want to interject myself into it since The FU was doing his usually great job of explaining things.
    I do have a few questions about what you're trying to accomplish.

    First what is the intended use for the second hard drive /dev/sdb? It doesn't appear to be formatted.

    Second is vgubuntu-swap_1 actually used as swap? You can check that by running the command below:
    Code:
    $ swapon
    It will list any currently available swap. An LV can be formatted as swap and lsblk will list it swapon will show it as a partition even though it really isn't. This LV is formatted as ext4 and may contain a swap file. swapon will list it if it's active, but I don't think a swap file can be active on it since it doesn't appear to be mounted. swap is not technically necessary and the amount of swap that's recommended varies depending on who you ask. I generally set swap equal to RAM, others think that that is too much, and recommend 50% of RAM, but drives are cheap and big these days. Back in the olden days the usual recommendation was 200% of RAM almost nobody does that today. Ideally if you have enough RAM you won't use any swap.

    Finally you can check /etc/fstab and see if vgubuntu-swap_1 is listed in it.

    Enough of my digression.

    In any event good luck.

    --
    Rob
    Last edited by rsteinmetz70112; July 22nd, 2021 at 03:45 PM.

  4. #14
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Unknown partition

    swap doesn't get "mounted". It does need an entry in the fstab. swapon -s and free -h will show active swap.
    Code:
    $ swapon -s
    Filename                                Type            Size    Used    Priority
    /dev/dm-1                               partition       4300796 47308   -2
    
    $ free -h
                  total        used        free      shared  buff/cache   available
    Mem:          3.8Gi       1.2Gi       256Mi       8.0Mi       2.4Gi       2.4Gi
    Swap:         4.1Gi        46Mi       4.1Gi
    There was a long discussion about swap about 13-15 months ago in these forums. Lots of different opinions provided. If there is interest, go read that.

    There are so many old swap sizing recommendations that were used when our systems had 32MB of RAM and a HDD of 1GB was huge. Those days are gone but those swap size recommendations just won't die. There are lots of old recommendations for many Linux/Unix things that get carried forward - I certainly do some things the old way too. The trick is to know why the old rules of thumb existed and when they don't make sense anymore.

  5. #15
    Join Date
    Mar 2007
    Beans
    1,116

    Re: Unknown partition

    If you use a swap file the device it is in I think does need to be on a mounted filesystem.

  6. #16
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Unknown partition

    Quote Originally Posted by rsteinmetz70112 View Post
    If you use a swap file the device it is in I think does need to be on a mounted filesystem.
    Definitely. LVs are more like swap partitions, however.
    I've never used a swap file on Linux or Unix. Just seems like a terrible idea. Just because MSFT does something, that doesn't mean it is a good idea. Sure, a swap file can be an option on a system that doesn't use GPT and already has 3 partitions abused by Windows, but using LVM makes the mandated need for fewer partition moot.

    Using GPT removes the need for swap files. Effectively no real limitation on the number of partitions possible.
    Using LVM removes the need for swap files. Effectively no real limitation on the number of LVs possible.

  7. #17
    Join Date
    Jul 2021
    Beans
    6

    Re: Unknown partition

    Quote Originally Posted by rsteinmetz70112 View Post
    I've been following this discussion but didn't want to interject myself into it since The FU was doing his usually great job of explaining things.
    I do have a few questions about what you're trying to accomplish.

    First what is the intended use for the second hard drive /dev/sdb? It doesn't appear to be formatted.
    Both drives are ssd, I don't know if this matters.
    Originally I was thinking to install Windows in that second drive, but now I think it won't happen. So, at the moment, those 240 GB are free.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •