The original partition /data of the Linux system has data. To reinstall the system without formatting the /data partition
need to prepare a virtual machine with a /data partition
Then load the ISO and start reinstalling and keep the /data partition
Load directly to the partition interface
Follow what you learned at the beginning The /data partition is 2048MB, so just choose to keep this partition
Free online learning video tutorial recommendation: linux video tutorial
Then delete the other partitions Then repartition
Then wait for the system to be reinstalled as usual
After the system is reinstalled, go in and check the /data partition file, which still proves that it has been successful.
Add a disk to the system and use LVM management to expand the existing volume group
Enter the system and view the partition df -h
You can see the two partitions using LVM when installing the system: /, /var
View the volume group name and volume group usage vgdisplay
Check the space status of the current logical volume, as shown below:
. Now I feel that 8G of /var is not enough, and I want to expand it to 28G.
Insert a new 20G hard disk; use 'fdisk -l' to view
Format partition operation 'fsdisk /dev/sdb'
Set the newly added disk to LVM mode
Confirm the partition
Create the newly added partition /dev/sdb1 as a physical volume
Expand the volume group centos. Expand the physical volume /dev/sdb1 to centos
At this time, centos has 20G free space. Expand all /dev/sdb1 to /var
At this time, although the 20G disk has been extended to /var, it has not been written to the file system. Enter /etc/fstab to confirm
Write to the file system to make the expansion effective
Recommended related articles and tutorials: linux tutorial
The above is the detailed content of How to reinstall the linux system. For more information, please follow other related articles on the PHP Chinese website!