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

Thread: Cannot remove items from full disk

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

    Re: Cannot remove items from full disk

    Quote Originally Posted by LHammonds View Post
    Hold up there boss. Your total size for the VAR volume is 4 GB (as shown by lvs). The size of your /var file system is 2 GB (as shown by the df). That means you have 2 GB of room right?

    Do this command and see if it gives you extra breathing room:

    Code:
    sudo resize2fs /dev/LVG/var 3G
    So, whenever using lvextend, **always** add the -r switch. This will do the resize2fs automatically.

    I think your VM storage is the real issue long term. You can easily cut that 50% to get some flexibility back for your LVM setup. Probably best to do that from a Try Ubuntu boot so nothing gets mounted. Definitely backup anything you cannot lose first. And use lvreduce -r (so it resizes the file system at the same time).

    If this storage is on SSDs, leaving 20% unused should vastly increase the lifespan of the SSD. Add in another 10% so you can easily have snapshots for backup purposes and you'd be doing well. That will make a trivial 2G out of space issue 5 seconds to solve in any LV in the same VG. Being able to quickly add 1-10GB to an LV is key. That's what not having the entire VG used up is good at.

    BTW, none of us knew all this when we started with LVM. Experience is the best teacher. I once lost 80% of my personal data due to a bad LVM decision about 20 yrs ago. Of course, at the time, I thought I was being brilliant and taking advantage of the capabilities of LVM. 1 disk in a 3 disk RAID0 failed. It wasn't good. I bet those 3 disks are on a shelf here somewhere ... because I couldn't take the idea that the data was all gone. Someday, I'd get it all back, right?

  2. #12
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    1,690
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Cannot remove items from full disk

    I have not ever used the "reduce" commands so I have no experience to share other than google searching which I'm sure you could do as well.

    I have not removed an LV before either but know its possible. Once removed, you might need to edit /etc/fstab and keep it from trying to mount the missing volume unless the lvremove command handles that for you too...but I don't know.

    But no matter what you do, make sure you have a GOOD backup of your data. Assume that a reduction or removal will go poorly and have a way to get it back.

    EDIT: Ninja'd by TheFu!

    LHammonds
    Last edited by LHammonds; September 28th, 2021 at 12:20 AM.

  3. #13
    Join Date
    Oct 2004
    Beans
    456
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Cannot remove items from full disk

    Thanks guys I am going to read up on lvreduce first before anything else

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

    Re: Cannot remove items from full disk

    The lvextend and lvreduce commands can only resize certain file systems with the -r switch (there's a longer switch version, if you want more clarity), so be certain you have one of those file systems. I don't think XFS is supported - XFS can never be reduced. That's limitation of that file system.

    Definitely read the entire manpage for lvreduce. There are gotchas.

  5. #15
    Join Date
    Oct 2004
    Beans
    456
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Cannot remove items from full disk

    I managed to remove 24 unused kernels now, Yay. Also finally did updates. Now getting other errors, started a new thread

    Will read the manpage when I finally get the mail server and webserver backup and running

    Thank you Fu!

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
  •