هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
Shrinking is risky: if the LV gets smaller than the file system, data is lost. lvreduce -r checks and shrinks the file system before the LV (it may need to unmount it; newer lvm2 asks or does it with --fsmode manage).
XFS file systems cannot be shrunk. To make an XFS volume smaller: back up, recreate smaller, restore.
طريقة الكتابة
lvreduce (-L [-]SIZE | -l [-]EXTENTS) [-r] [OPTION]... VG/LVالخيارات 21
الأكثر استخدامًا
Common LVM options
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Shrink an ext4 LV safely
lvreduce -r -L 3G /dev/vgfiles/lvdocsRuns e2fsck and resize2fs, then shrinks the LV.
2Remove 1 GiB
lvreduce -r -L -1G /dev/vgfiles/lvdocsRelative size.
3Check the free space first
df -h /docsThe data must fit into the new size.
4Do it by hand (old way)
umount /docs e2fsck -f /dev/vgfiles/lvdocs resize2fs /dev/vgfiles/lvdocs 3G lvreduce -L 3G /dev/vgfiles/lvdocs mount /docsFile system first, then LV — never the other way.
5Test only
lvreduce -t -r -L 3G /dev/vgfiles/lvdocsShows what would happen.
6XFS cannot shrink
lvreduce -r -L 3G /dev/vgfiles/lvfilesFails for XFS: back up, lvremove, lvcreate smaller, mkfs.xfs, restore.
7Shrink a swap LV
Swap holds no data after swapoff.
8Free space for another LV
lvreduce -r -L -2G /dev/vgdata/lvweb; lvcreate -n lvnew -L 2G vgdataMove space between LVs in one VG.
9Verify the data afterwards
Your files are still there.
10Back up before shrinking
tar -czf /root/docs-backup.tgz -C /docs .Always, on real systems.
لا يوجد شيء يطابق هذا الفلتر.
انتبه
- Never lvreduce without -r on an LV with a file system: the end of the file system is cut off.
رموز الخروج
0 :: Done. 5 :: Error.