[SOLVED] what is a logical partitions and group partitions and how to check disk space on a partition
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
what is a logical partitions and group partitions and how to check disk space on a partition
Hi all ,
I have just started to organize ideas in my mind about 'Physical disks' 'logical partition groups' and 'logical partitions'
and 'real partitions'
I understood from a couple of reads-up that we have real partitions expl : (dev/sda1 , dev/sda2...), we have 'Group partitions' exp: (vg0), and then the logical partitions as of (/var, /home ...)
What i don't understand is:
Why and what is the use of logical partitions?
What is the use of partition groups ?
Can I think of 'dev/sda1' as (C,D partitions on windows) ? or is that more like the logical partitions ?
How can I list the files-by-their-size contained in a logical partition ?
The reason that brings me to this point is that if I use this command:
And I see that i have a problem in disk space on 'Root' '/' , but don't know how to solve it because then if I go to :
Code:
cd /
The folder '/var' is inside '/' but its also in an other 'logical partition',
Does the output (1) means that when i check for problematic files i have to exclude the ones that are on other logical partitions ?
If someone gets my struggle please guide me, Any help is appreciated
In LVM, physical volumes (partitions on a disk) are added to a group, called a volume group (VG). A VG is just a collection of physical partitions available for use. This group is then used as a larger bin, that can then be subdivided into individual partitions (called logical volumes). It's not dissimilar to grouping your disks into a RAID 0 array, and then partitioning that array as needed.
LVM is optional, there's no requirement to use it. The point of it is easy re-sizing and moving of volumes, since they're no longer physically tied to hardware, they're only tied to a "group" of disks, that can be added to or subtracted from (I think) as needed.
If you don't use LVM, then you can just use regular partitions on regular disks. sda1 would be partition 1 on device A, which might be like your C: drive. sda2 would be partition 2 on device A, which might be like your D: drive. sdb1 would be partition 1 on device B, which might be like your E: drive, and so on.
With LVM, both disks A and B would be added to a VG, and then that VG could be subdivided into three individual LVs, which might be like your C:, D:, and E: drives. The point is these three VGs could be sized as needed without worrying about individual disk boundaries.
Now as for your second question, that comes down to the Linux filesystem, and is independent of LVM. With Windows, every disk has its own tree that starts at "My Computer". From there you pick your disk/partition, and then go into it. The entire OS is always on C:, programs are usually on C: but can usually be installed on a different one at the time of installation, and data can be put wherever you like. C:, D:, E: all have independent trees, that don't mix.
On Linux, there is ONE tree, that starts at /. Everything is located inside this one tree. Drives/partitions (or LVs) are mounted in subdirectories of /, as needed. Take your system for example, you have a separate filesystem (an LV called vg0-Home) which is mounted at /home. When that filesystem is mounted, everything that is placed inside /home or a subdirectory of /home, goes on that LV. If you were to unmount that LV, you'd find that /home is now empty. Anything placed in /home at that point would go on the filesystem that holds the parent, in this case /, or your LV vg0-Root. If you were to then re-mount your vg0-Home LV, the contents of /home would be replaced with what's in that filesystem, and the files you just created in /home on vg0-Root would be covered up. They would still exist, but you wouldn't be able to access them until vg0-Home was unmounted again.
Instead of each filesystem having its own, independent tree, in Linux all filesystems share a single tree. This makes it trivially easy to move data transparently between disks, without affecting anything on the system. This is also why I feel LVM is a bit over-rated. Having a big flexible bucket that you can use to resize LVs and move them around is all well and good if the Linux tree was rigid and unflexible like Windows. But as it is, I don't really see the need for LVM, since you can move directories between filesystems all you want without affecting the behavior of the system. If a filesystem fills up, just offload a few of the big directories to a different one and re-mount them in place, there's no need to go out of your way to shrink other partitions or LVs to make room to expand the full one.
Last edited by suicidaleggroll; 02-05-2016 at 11:33 AM.
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508
Rep:
Quote:
Originally Posted by ITareliteralyMyInitials
Hi all ,
I have just started to organize ideas in my mind about 'Physical disks' 'logical partition groups' and 'logical partitions'
and 'real partitions'
You need to decide if your partitions continually get big or small with data and thus need to be changed in size in a fluid way. This may be useful for a server.
If this is not your case, then you don't need LVM, imo. Go for a normal partitioning scheme like everyone else.
That way, your partitioning problems will be similar to more people.
Thank you for your explanations above , the thing is that i am in no position right now to not use LVM , As it is not a Lab Environment i am working on .
I had a look at this documentation https://www.turnkeylinux.org/blog/extending-lvm , and I understood that in my case there is no free space Left for VG or Physical partition, and that to resolve my issue i would need to extend the physical partition which i can't since if i run ,
Quote:
pvdisplay
I get :
Quote:
--- Physical volume ---
PV Name /dev/sda2
VG Name vg0
PV Size 59.50 GB / not usable 30.20 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1903
Free PE 0
Allocated PE 1903
PV UUID QpvPb6-1QWT-qfyc-Ycev-fOPH-E1kf-OmvOre
In that Link above it is stated that i would need to extend the underlying device , but what other options do i have .
-Can I borrow space from other VPs ? lets say from (/dev/mapper/vg0-Opt) , If that is possible can you please show me how ?
The most straightforward approach would be to have the host assign more disk space to your VM, either by enlarging the existing disk or assigning a new one. Then you would have more space for extending volume group vg0 and logical volume vg0-Root.
If you can't do that, then perhaps you could take away a couple of GB from vg0-Opt (currently 27% full, 33G available) and use that to enlarge vg0-Root. Shrinking vg0-Opt would require that the filesystem there be unmounted temporarily, which would require stopping any processes using files there. Assuming the vg0-Opt is a filesystem that can be shrunk (xfs cannot) and that vg0-Root is a filesystem that permits online expansion (most do), the steps would be:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.