国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
4.Expand physical disk space" >4.Expand physical disk space
Home Computer Tutorials Computer Knowledge How to expand the default LVM space of Linux

How to expand the default LVM space of Linux

Feb 19, 2024 pm 07:30 PM
lvm volume System installation volume group

How to expand the default LVM space of Linux

1. Introduction to Linux LVM

Linux Logical Volume Manager (LVM) is a tool for managing disks and storage space, providing flexible storage management through volume groups and logical volumes. The core concepts of LVM include physical volumes, volume groups and logical volumes.

  • Physical Volume (PV): A physical volume is a physical hard disk or partition, which is used by LVM to store data. LVM combines one or more physical volumes into volume groups.
  • Volume Group (VG): A volume group is a logical storage unit composed of one or more physical volumes. Logical volumes are created on volume groups, and they can dynamically allocate and reclaim storage space. A system can contain multiple volume groups.
  • Logical Volume (LV): A logical volume is a logical storage unit created on a volume group. They can be formatted as a file system and mounted on the file system tree like ordinary hard disk partitions. The size and location of logical volumes can be dynamically adjusted at runtime without shutting down or restarting the system.

The following is a visual diagram of the working principle of LVM. Assume there are 5 different disks, each with a partition mapped to a physical volume (PV), and these disks are combined into a volume group (VG), which is split into two different logical volumes (LV), Each LV is used for one file system.

picture

Assume that a disk with 100GB space is divided on the ubuntu system. According to the LVM principle, the division level is as follows:

2.Linux system installation program default settings

When installing the Ubuntu system, a screen prompt will appear requiring approval of the storage layout. By default, the storage layout will include several small boot partitions and a third partition that LVM will use to create the root file system.

picture

picture

3. Use the default available space

By default in Ubuntu, the root file system uses less than half of the total disk space. You can use the df -h command to check the free space of the root file system.

As shown in the figure, only about 14% of the 49GB storage space is currently used. In actual use, this part of the space may be filled up quickly. So now the task is to expand this 49GB volume.

To check the existing free space on the volume group (the space left by the installation program's default settings), you can run: vgdisplay command to check the available space, as shown in the figure:

As you can see from the picture above, there is approximately 49.25GB of space available. Of course, the available space here may not be enough, as will be discussed below.

To use the available space on the volume group (VG) of the root logical volume (LV), you can first run: lvdisplay command to check the logical volume size, and then run:

lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

Expand the LV to the maximum available size, and then run lvdisplay again to ensure that the change is successful, as shown in the figure:

At this time, the size of the block volume where the root file system is located has been increased, but the file system still needs to be expanded on top of it. Run df -h to check the root file system, and then run the command:

resize2fs /dev/mapper/ubuntu — vg-ubuntu — lv

Expand the file system, and run df -h again to confirm, as shown in the figure:

picture

You can see that the space left by the system by default has been allocated successfully. If the space is still not enough, you need to expand the basic disk to allocate more space.

4.Expand physical disk space

Assume that the expansion space plan is to expand the current 100GB to 200GB. In actual applications, the expanded space may be a virtual machine or a RAID controller or other storage system. First, execute the: cfdisk command to check and see whether the available space is listed. space, use q to exit after completion, as shown in the figure:

If you don’t see the available space listed, you can use:

echo 1>/sys/class/block/sda/device/rescan

Start the rescan of /dev/sda. After completion, re-run cfdisk. You should be able to see the new available space, as shown in the figure:

Select the /dev/sda3 partition from the list and select "Resize" from the bottom menu. Press the Enter key and it will prompt to confirm the new size. Press the Enter key again and you will see that the /dev/sda3 partition has the new space size.

Select "Write" from the bottom menu, enter yes to confirm, then press Enter, enter q to exit the program.

Now that the LVM partition of the /dev/sda3 physical volume (PV) has been extended, you need to extend the PV and run the command:

pvresize /dev/sda3

Perform this operation, and then use pvdisplay to check the new size, as shown in the figure:

picture

Now you can see that the PV has increased from 98.5GB to 198.5GB. Use vgdisplay again to check the available space of the volume group (VG), as shown in the figure:

picture

You can see that VG has 100GB of available space, continue to enter the command:

lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

Expand LV to use up all available space of VG, and then execute the lvdisplay command to ensure the change is successful, as shown in the figure:

picture

At this time, the block volume of the root file system has been expanded, but the file system itself has not yet been resized to adapt to the new volume. First, check the current size of the file system with df -h, and then run the command:

resize2fs /dev/mapper/ubuntu — vg-ubuntu — lv

Adjust the size, and run df -h again to check the available space of the new file system, as shown in the figure:

picture

You can see that the physical disk has been successfully expanded and the available space has been extended up to the LVM abstraction layer. The root file system already has enough space.

The above is the detailed content of How to expand the default LVM space of Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to install WinNTSetup into Win11 system_How to install WinNTSetup into Win11 system How to install WinNTSetup into Win11 system_How to install WinNTSetup into Win11 system May 08, 2024 am 11:19 AM

First download the latest Win11 system ISO image, and then in Win10 system, you can directly right-click on the downloaded ISO image file and select [Load]; if it is under WinPE, WinXP, or Win7 system, you need to use the virtual optical drive tool to load the ISO Image; or you can directly decompress the ISO image file without using a virtual optical drive. Then run WinNTSetup. The software interface is as shown in the figure: First locate the location of the install.wim file. You can find the install.wim file in the sources directory of the Win11 ISO image loaded or decompressed by the virtual optical drive. Then set the location of the boot disk and installation disk. Generally, you are going to put W

Reasons why Baidu Netdisk download failed 125201 Reasons why Baidu Netdisk download failed 125201 Apr 30, 2024 pm 10:42 PM

Baidu Netdisk download failed 125201 Error reason: Network problems: unstable/slow connection, router failure, busy server File problems: damaged/incomplete files, invalid links Baidu Netdisk restrictions: download limit exceeded, membership expiration/account restricted Browser/application issues: out-of-date version/poor compatibility, download manager failure System issues: viruses/malware, missing components/drivers

How to enter bios after assembling a computer? How to enter bios when assembling a computer? How to enter bios after assembling a computer? How to enter bios when assembling a computer? May 07, 2024 am 09:13 AM

How to enter bios after assembling a computer? Before entering the BIOS, you need to make sure that the computer is completely shut down and powered off. Here are several common ways to enter the BIOS: 1. Use shortcut keys: Most computer manufacturers will display a prompt message at startup telling you which key to press to enter the BIOS settings. Usually the F2, F10, F12 or Delete key. After pressing the appropriate keys, you should be able to see a screen with information about your computer's hardware and BIOS settings. 2. Use the button on the motherboard: Some computer motherboards have a dedicated button for entering BIOS settings. This button is usually labeled "BIOS" or "UEFI". After pressing the button you should be able to see

How to install Windows system on tablet computer How to install Windows system on tablet computer May 03, 2024 pm 01:04 PM

How to flash the Windows system on BBK tablet? The first way is to install the system on the hard disk. As long as the computer system does not crash, you can enter the system and download things, you can use the computer hard drive to install the system. The method is as follows: Depending on your computer configuration, you can install the WIN7 operating system. We choose to download Xiaobai's one-click reinstallation system in vivopad to install it. First, select the system version suitable for your computer, and click "Install this system" to next step. Then we wait patiently for the installation resources to be downloaded, and then wait for the environment to be deployed and restarted. The steps to install win11 on vivopad are: first use the software to check whether win11 can be installed. After passing the system detection, enter the system settings. Select the Update & Security option there. Click

How to upgrade Win11 system on old computers_Tutorial on upgrading Win11 system on old computers How to upgrade Win11 system on old computers_Tutorial on upgrading Win11 system on old computers May 07, 2024 pm 08:07 PM

1. First we need to download the win11 image file. 2. Put the downloaded win11 image into another disk. 3. Then we find the win11 image file among the searched image files. 4. Then when we come to this interface, we select install.wim to proceed to the next step. 5. Then select the Windows 11 system and click OK to restore the image file. 6. Then we wait for pe to download and install. Wait patiently. After the download is completed, click restart according to the prompts. 7. Then come to this interface, we select the second xiaobaiPE. After selecting, the win11 system will be automatically installed for us. After the installation is completed, click to restart the computer immediately according to the prompts. 8. Finally, the system installation is completed, and we come to

What you need to know when reinstalling the system from a USB flash drive: How to set up the BIOS correctly What you need to know when reinstalling the system from a USB flash drive: How to set up the BIOS correctly May 06, 2024 pm 03:00 PM

Reinstalling the system is a problem that many computer users often encounter. Whether it is due to system crash, poisoning or wanting to upgrade the system, reinstalling the system is a good choice. However, many people encounter various problems when reinstalling the system, such as not knowing how to set up the BIOS, not knowing how to choose a suitable installation disk, etc. Today, we will talk about some things you must know when reinstalling the system from a USB flash drive, and teach you how to set up the BIOS correctly and successfully complete the system reinstallation. Tool materials: System version: Windows1020H2 Brand model: Lenovo Xiaoxin Air14 Software version: Pocket machine One-click reinstallation of system software v1.0 1. Preparation 1. Prepare a U disk with a capacity of no less than 8GB, preferably USB3. 0, so the speed will be faster

Does the newly assembled computer keyboard light not light up? Does the newly assembled computer keyboard light not light up? May 07, 2024 pm 04:40 PM

Does the newly assembled computer keyboard light not light up? The motherboard model should be UEFIbios. First find a keyboard with PS2 port, enter bios, turn off UEFI boot, and change to Legacy mode. If there is fast boot, turn off options like FastBoot, UEFI boot, turn on fast boot, and enter the system. USB interface detection may be turned off before, and USB devices can be used to assemble the computer after entering the system. The mouse and keyboard lights do not light up when the computer is turned on? If the keyboard light does not come on, there is a high possibility of memory failure, or it may be caused by static electricity on the motherboard or the motherboard is faulty. Use an eraser to wipe the gold finger of the memory graphics card, and remove and insert the memory several times. The problem remains. There are dual memory sticks and a single memory stick is used for testing. The problem persists. Re-plug the various cables inside and outside the chassis, and then unplug the connector on the motherboard.

How to assemble an acer desktop computer? How to assemble an acer desktop computer? May 08, 2024 pm 08:25 PM

How to assemble an acer desktop computer? The assembly method of Acer desktop computer is as follows: open the case, install the power supply into the case, and tighten the screws. Install the CPU onto the motherboard, making sure the pins on the CPU are aligned with the slots on the motherboard, and tighten the screws on the CPU heat sink. Install the memory module onto the motherboard, making sure that the bumps on the memory module are aligned with the slots on the motherboard. Press down hard until you hear a "pop" sound to complete the installation. Install graphics cards, sound cards, network cards and other boards onto the motherboard, making sure the screws on the boards are tightened. Install storage devices such as hard drives and optical drives into the chassis, making sure the screws are tightened. Connect the motherboard to the chassis, including power cables, hard drive cables, optical drive cables, etc. Finally, close the chassis cover and tighten the screws to complete the assembly. exist

See all articles