هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
lvcreate -n NAME -L SIZE VG makes an LV; -l gives the size in extents or percent (-l 100%FREE). The new device is /dev/VG/NAME; put a file system on it and mount it.
lvcreate also makes snapshots (-s), thin pools and thin volumes (-T), striped, mirrored and RAID volumes, cache and VDO volumes (with --type).
طريقة الكتابة
lvcreate -n NAME (-L SIZE | -l EXTENTS) [OPTION]... VG [PV...]
lvcreate -s -n NAME -L SIZE VG/LV
lvremove [OPTION]... VG/LV...الخيارات 46
الأكثر استخدامًا
Basic
Types
Common LVM options
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1LV with a size
lvcreate -n lvdata -L 5G vgdata Logical volume "lvdata" created.Device: /dev/vgdata/lvdata.
2LV with a number of extents
lvcreate -n lvfiles -l 50 vgfiles50 × PE size (see vgdisplay).
3Use all free space
lvcreate -n lvweb -l 100%FREE vgdataOr 50%FREE for half.
4File system and mount
mkfs.xfs /dev/vgdata/lvdata mkdir /data; echo "/dev/vgdata/lvdata /data xfs defaults 0 0" >> /etc/fstab systemctl daemon-reload; mount -aThe usual next steps.
5A swap LV
lvcreate -n lvswap -L 2G rhel; mkswap /dev/rhel/lvswapAdd it to fstab as swap.
6Snapshot for a backup
lvcreate -s -n lvdata-snap -L 1G /dev/vgdata/lvdata mount -o ro,nouuid /dev/vgdata/lvdata-snap /mntFrozen view; back up /mnt, then remove the snapshot. (nouuid is needed for XFS.)
7Thin pool and thin volume
lvcreate -T -L 10G vgdata/pool1 lvcreate -T -V 50G -n lvthin vgdata/pool1Over-provisioning: watch the pool usage!
8Place an LV on a chosen PV
lvcreate -n lvfast -L 2G vgdata /dev/nvme0n1p3For example on the faster disk.
9Remove an LV
umount /data; lvremove /dev/vgdata/lvdata Do you really want to remove active logical volume vgdata/lvdata? [y/n]: yRemove the fstab line too.
10RAID1 mirror LV
lvcreate --type raid1 -m 1 -n lvsafe -L 2G vgdataTwo copies on different PVs.
لا يوجد شيء يطابق هذا الفلتر.
رموز الخروج
0 :: Done. 5 :: Error.