In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to create the LVM of XFS file system under Ubuntu. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Preface
Lvm (Logical Volume Manager) logical volume management can meet the needs of the linux system to dynamically adjust the size of each partition and meet the needs of the server in different running periods.
Used to play LVM under Linux, generally choose ext3, ext4 format file system, recently installed and configured a MySQL database server under Ubuntu 16.04.5, then tested the LVM of the XFS file system, in fact, careful comparison, the difference is not much, just the difference between file formatting and pieces of the system to adjust the different commands. Many of the following places do not explain too much, but simply record the testing process.
Add a new disk to the test server, as shown below, and the new disk is / dec/sdc
Root@mylnx12:~# fdisk-lDisk / dev/sdb: 605 GiB, 649613803520 bytes, 1268776960 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x2c2c38b3 Device Boot Start End Sectors Size Id Type/dev/sdb1 2048 1268772864 605G 7 HPFS/NTFS/exFAT Disk / dev/sda: 30 GiB, 32212254720 bytes 62914560 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x6e2369f9 Device Boot Start End Sectors Size Id Type/dev/sda1 * 2048 62914526 62912479 30G 83 Linux Disk / dev/sdc: 1023 GiB, 1098437885952 bytes 2145386496 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x030b81c8 Device Boot Start End Sectors Size Id Type/dev/sdc1 2048 2145386495 2145384448 1023G 83 Linux # create PVroot@mylnx12:~# pvcreate / dev/sdc1 Physical volume "/ dev/sdc1" successfully createdroot@mylnx12:~# pvscan PV / dev/sdc1 lvm2 [1023.00 GiB] Total: 1 [1023.00 GiB] / in use: 0 [0] / in no VG: 1 [1023.00 GiB] # create VGroot@mylnx12:~# vgcreate-s 32m VolGroup01/ dev/sdc1 Volume group "VolGroup01" successfully created # add LVroot@mylnx12:~# lvcreate-L + 400G-n LogVol00 VolGroup01WARNING: xfs signature detected on / dev/VolGroup01/LogVol00 at offset 0. Wipe it? [y/n]: y Wiping xfs signature on / dev/VolGroup01/LogVol00. Logical volume "LogVol00" created.root@mylnx12:~# lvscan ACTIVE'/ dev/VolGroup01/LogVol00' [400.00 GiB] inherit # format root@mylnx12:~# mkfs.xfs / dev/VolGroup01/LogVol00meta-data=/dev/VolGroup01/LogVol00 isize=512 agcount=4, agsize=26214400 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=0data = bsize=4096 blocks=104857600, imaxpct=25 = sunit=0 swidth=0 blksnaming = version 2 bsize=4096 ascii-ci=0 ftype=1log = internal log bsize=4096 blocks=51200, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime = none extsz=4096 blocks=0 Rtextents=0 # mount point setting root@mylnx12:~# mkdir / mysql_dataroot@mylnx12:~# mount-t xfs / dev/VolGroup01/LogVol00 / mysql_dataroot@mylnx12:~# vgdisplay-Volume group-VG Name VolGroup01 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 1022.97 GiB PE Size 32.00 MiB Total PE 32735 Alloc PE / Size 12800 / 400.00 GiB Free PE / Size 19935 / 622.97 GiB VG UUID 8kutIc-bjId-rNWK-UCHo-TU2l-xkwa-idBXCj # create another LVroot@mylnx12:~# lvcreate-l 19935-n LogVol01 VolGroup01 Logical volume "LogVol01" created.root@mylnx12:~# mkfs.xfs / dev/VolGroup01/LogVol01meta-data=/dev/VolGroup01/LogVol01 isize=512 agcount=4 Agsize=40826880 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=0data = bsize=4096 blocks=163307520, imaxpct=25 = sunit=0 swidth=0 blksnaming = version 2 bsize=4096 ascii-ci=0 ftype=1log = internal log bsize=4096 blocks=79740, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime = none extsz=4096 blocks=0 Rtextents=0root@mylnx12:~# mkdir / mysql_backuproot@mylnx12:~# mount-t xfs / dev/VolGroup01/LogVol01 / mysql_backup/root@mylnx12:~# df-hFilesystem Size Used Avail Use% Mounted onudev 6.9G 0 6.9G 0 / devtmpfs 1.4G 8.6m 1.4G 1% / run/dev/sda1 30G 2.1G 27G 8% / tmpfs 6.9G 06.9G 0% / dev/shmtmpfs 5. 0m 0 5.0m 0% / run/locktmpfs 6.9G 06.9G 0% / sys/fs/cgroup/dev/sdb1 596G 70M 566G 1% / mnttmpfs 1.4G 0 1.4G 0% / run/user/1000/dev/mapper/VolGroup01-LogVol00 400G 441M 400G 1% / mysql_data/dev/mapper/VolGroup01-LogVol01 623G 668M 623G 1% / mysql_backup
Modify the configuration file / etc/fstab to add the following configuration information, as shown below, so that it can be saved permanently to ensure that the relevant mount point information is not lost at the next boot.
UUID= "a72bd3f8-eb2d-40cb-92c3-d5e32c30d5ff" / mysql_data xfs defaults 0 2UUID = "33325d87-f3f4-4215-abf7-ee795724697e" / mysql_backup xfs defaults 0 2
In addition, the adjustment command of the ext2/ext3/ext4 file system is resize2fs (both increase and decrease are supported), while the adjustment command of the XFS file system is xfs_growfs (only supports growth). Of course, if you want to decrease, you can only mount the logical partition by reformatting the logical partition through the mkfs.xfs command after the reduction, so that the original data on this logical partition will be lost. It doesn't make any sense.
This is the end of this article on "how to create LVM for XFS file system under Ubuntu". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
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.