熱搜:win11繞過硬件限制安裝 一鍵重裝Win10系統(tǒng) 最干凈的u盤啟動盤 真正純凈版的win7系統(tǒng)
時間:2015-02-12 17:35:12 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時看資訊 2. 請使用手機(jī)瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20150212/38335.html 手機(jī)查看 評論 反饋
當(dāng)擴(kuò)展完物理邊界后你會發(fā)現(xiàn),掛載中的邏輯卷還是本身的大小。
[root@station106 ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg0-root
ext4 20G 387M 19G 3% /
tmpfs tmpfs 242M 0 242M 0% /dev/shm
/dev/sda1 ext4 194M 29M 156M 16% /boot
/dev/mapper/vg0-usr
ext4 9.9G 1.9G 7.6G 20% /usr
/dev/mapper/vg0-var
ext4 20G 288M 19G 2% /var
/dev/mapper/myvg-test
ext4 9.9G 151M 9.2G 2% /mnt
擴(kuò)展邏輯邊界,邏輯邊界指的是掛載后,在使用中的邏輯卷也直接識別了。
。踨oot@station106 ~]# resize2fs /dev/myvg/test
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/myvg/test is mounted on /mnt; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/myvg/test to 3932160 (4k) blocks.
The filesystem on /dev/myvg/test is now 3932160 blocks long.
。踨oot@station106 ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg0-root
ext4 20G 387M 19G 3% /
tmpfs tmpfs 242M 0 242M 0% /dev/shm
/dev/sda1 ext4 194M 29M 156M 16% /boot
/dev/mapper/vg0-usr
ext4 9.9G 1.9G 7.6G 20% /usr
/dev/mapper/vg0-var
ext4 20G 288M 19G 2% /var
/dev/mapper/myvg-test
ext4 15G 153M 14G 2% /mnt
上述就是擴(kuò)展邏輯卷部分。
實例演示:縮小邏輯卷。首先為了測試我去原先掛載的錄下創(chuàng)建一些文件,測試一下縮小后會不會導(dǎo)致文件消失。
縮小邏輯卷的步驟如下:
1)先卸載之前的掛載,并執(zhí)行強(qiáng)制檢測。
[root@station106 ~]# umount /mnt/
。踨oot@station106 ~]# e2fsck -f /dev/myvg/test
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/myvg/test: 13/983040 files (0.0% non-contiguous), 100864/3932160 blocks
2)縮減邏輯邊界。
。踨oot@station106 ~]# resize2fs /dev/myvg/test 10G
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/myvg/test to 2621440 (4k) blocks.
The filesystem on /dev/myvg/test is now 2621440 blocks long.
3)縮減物理邊界。
。踨oot@station106 ~]# lvreduce -L 10G /dev/myvg/test
WARNING: Reducing active logical volume to 10.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce test? [y/n]: y
Reducing logical volume test to 10.00 GiB
Logical volume test successfully resized
縮減后查看:
。踨oot@station106 ~]# lvdisplay /dev/myvg/test
--- Logical volume ---
LV Path /dev/myvg/test
LV Name test
VG Name myvg
LV UUID wY1YUF-f0o6-jzu1-mtTL-64p0-qvfC-3QfF8y
LV Write Access read/write
LV Creation host, time station106.magelinux.com, 2014-02-10 11:18:43 +0800
LV Status available
# open 0
LV Size 10.00 GiB-》這里又變成了10G。
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
掛載繼續(xù)使用并且查看文件是否存在。
。踨oot@station106 ~]# mount /dev/myvg/test /mnt/
。踨oot@station106 ~]# cd /mnt/
。踨oot@station106 mnt]# ls
accp benet lost+found--》查看還是存在。未丟失。
[root@station106 mnt]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg0-root
ext4 20G 387M 19G 3% /
tmpfs tmpfs 242M 0 242M 0% /dev/shm
/dev/sda1 ext4 194M 29M 156M 16% /boot
/dev/mapper/vg0-usr
ext4 9.9G 1.9G 7.6G 20% /usr
/dev/mapper/vg0-var
ext4 20G 288M 19G 2% /var
/dev/mapper/myvg-test
ext4 9.9G 151M 9.2G 2% /mnt
發(fā)表評論
共0條
評論就這些咯,讓大家也知道你的獨特見解
立即評論以上留言僅代表用戶個人觀點,不代表系統(tǒng)之家立場