In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to use LVM to expand volume space", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use LVM to expand volume space" this article.
LVM is a logical volume management tool that includes allocating disks, striping, mirroring, and resizing logical volumes. It is commonly used in Fedora installations (LVM + Ext4 before BTRFS was the default file system). But have you ever come across a GNOME prompt when booting the system that the home volume is almost out of space! Fortunately, there is likely to be some space in another volume that is not used and can be used for reallocation. Let's take a look at how to reclaim hard disk space with LVM.
The key to easily reallocating space between volumes is the logical Volume Manager (LVM). Fedora 32 and previous systems use LVM by default to divide disk space. This technology is similar to standard hard disk partitions, but LVM is more flexible. LVM can not only achieve flexible volume size management, but also achieve some advanced functions, such as reading and writing snapshots, data striping or mirroring on multiple hard drives, using high-speed hard drives as caches for slow hard drives, and so on. All of these advanced options can be a little overwhelming, but resizing volumes is easy.
LVM Foundation
The volume group (VG) is the main container in the LVM system. By default, Fedora defines only one volume group, but you can define multiple volume groups as needed. The actual hard disk and hard disk partition are added to the volume group as physical volumes (PV). Physical volumes add available space to the volume group. A typical Fedora installation has a formatted boot partition and the rest of the hard disk is a partition configured as a LVM physical volume.
From this free space pool, the volume group allocates one or more logical volumes (LV). These volumes are similar to hard disk partitions, but there is no limit to contiguous space on the disk. LVM's logical volumes can even span multiple devices! Just like hard disk partitions, logical volumes have a defined size, can contain any file system, and can then be mounted to a specific directory.
What do you need?
Confirm that the system uses LVM in the gnome-disks application and ensure that space is available in other volumes. This guide is useless if there is no space to recycle from another volume. You also need a Fedora on-site CD/USB. Any file system that needs to be shrunk must be unmounted. Running from an on-site Live image keeps all volumes on the hard drive unmounted, even important directories like / and / home.
Use gnome-disks to verify free space
A word of warning
According to this guide, no data should be lost, but it does use some very low-level and powerful commands. One error may destroy all the data on the hard drive. So back up all the data on the disk first!
Resize LVM volumes
To start, start the Fedora live mirror and select "Try Fedora" in the dialog box. Next, use "Run Command" to launch the "blivet-gui" application (press Alt-F2, type blivet-gui, and then press enter). Select the volume group under "LVM" on the left. The logical volume is on the right.
Explore logical volumes in blivet-gui
The logical volume label consists of the volume group name and the logical volume name. In this example, the volume group is fedora_localhost-live, with home, root, and swap logical volumes assigned. To find the complete volume, select each volume, click the "gear" icon, and then select "resize". The slider in the resize dialog box represents the allowable size of the volume. The minimum value on the left is the space already used in the file system, so this is the smallest possible size (no data is deleted). The maximum value on the right is based on the maximum available space in the volume group.
Resize dialog in blivet-gui
The gray "resize" option means that the volume is full and there is no free space in the volume group.
Now you can change the size! Look at all the volumes, like the screenshot above, and find a volume with enough space. And as in the screenshot above, find a volume with a lot of extra space in all the volumes. Move the slider to the left to set the new size. Make enough space available for the entire volume, but still leave enough room for future data growth. Otherwise, this volume will be the next volume to be filled.
Click "resize" and notice that a new item appears in the volume list: "free space". Now select the volume you want to adjust this time and move the slider all the way to the right. Press the "resize" key and view the layout of the newly improved volume. However, nothing on the hard drive has changed yet. Click the "check" option to commit the changes to disk.
Review changes in blivet-gui
View a summary of the changes, and if everything looks correct, click "Ok" to continue. Wait for "blivet-gui" to complete. Now that you reboot back to Fedora, you can use the new space on the volume that was previously filled.
Plan for the future
It is difficult to know how much space any particular volume will need in the future. Instead of immediately allocating all available free space, consider setting aside free space in the volume group. In fact, Fedora Server reserves space in the volume group by default. It is possible to extend a volume when a volume is online and in use. No on-the-spot mirroring or reboot is required. When a volume is almost full, you can easily extend the volume and continue to work with some of the available space. Unfortunately, the default disk manager gnome-disks does not support resizing LVM volumes, so install blivet-gui as a graphical management tool. In addition, there is a simple terminal command to extend the volume:
Lvresize-r-L + 1G / dev/fedora_localhost-live/root above is all the content of this article "how to use LVM to expand volume space". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.