In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to add disks to create LVM under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Shell > fdisk / dev/xvdb # Select disk
Command (m for help): M # help
Command action
A toggle a bootable flag
B edit bsd disklabel
C toggle the dos compatibility flag
D delete a partition
L list known partition types
M print this menu
N add a new partition
O create a new empty DOS partition table
P print the partition table
Q quit without saving changes
S create a new empty Sun disklabel
T change a partition's system id
U change display/entry units
V verify the partition table
W write table to disk and exit
X extra functionality (experts only)
Command (m for help): n # create a new partition
Command action
E extended
P primary partition (1-4)
P # create a primary partition
Partition number (1-4): 1 # partition ID
First cylinder (1-65270, default 1):
Using default value 1
Last cylinder, + cylinders or + size {KMagne Mpeng} (1-65270, default 65270):
Using default value 65270
Command (m for help): t # modify partition type
Command (m for help): 8e # Linux lvm
Command (m for help): W # Save changes
Shell > pvcreate / dev/xvdb1/ # create a new pv volume
Shell > pvs # View pv volumes
Shell > vgcreate VolGroup01 / dev/xvdb1/ # create a new vg volume
Shell > vgs # View vg volumes
Shell > lvcreate-L 50G-n lvmServer VolGroup01 # create logical volume-L specify partition size-n specify lvm name
Shell > mkfs.ext4 / dev/VolGroup01/lvmServer # use the mkfs.ext4 command to create an ext4 file system on the logical volume lvmServer
Shell > mount / dev/VolGroup01/lvmServer / server/ # hang from partition to local directory / server
Shell > vi / etc/fstab # modify fstab boot auto mount
#
# / etc/fstab
# Created by anaconda on Thu Aug 14 21:16:42 2014
#
# Accessible filesystems, by reference, are maintained under'/ dev/disk'
# See man pages fstab (5), findfs (8), mount (8) and/or blkid (8) for more info
#
UUID=94e4e384-0ace-437f-bc96-057dd64f42ee / ext4 defaults,barrier=0 1 1
Tmpfs / dev/shm tmpfs defaults 0 0
Devpts / dev/pts devpts gid=5,mode=620 0 0
Sysfs / sys sysfs defaults 0 0
Proc / proc proc defaults 0 0
/ dev/VolGroup01/lvmServer / server ext4 defaults 0 0
: wq
# Save restart test
Note:
* fstab must fill in the path correctly. If there is an error, it may not start normally.
* you can mount it on rc.local using the mount command
Thank you for reading! This is the end of this article on "how to add disks to create LVM under Linux". 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, you can 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.