SAN儲存卷擴容後對應客戶端磁碟和掛載磁碟的分割槽如何正確顯示新增容量

lusklusklusk發表於2018-05-17
總結:
SAN儲存的卷可以不是LVM模式情況下,對卷新增容量後,客戶端需要重啟才可以看到卷對應的磁碟新增後的容量,再對該磁碟執行resize2fs後,該磁碟掛載的分割槽才可以看到新增後的容量


--確定需要新增容量的磁碟在客戶端顯示200G,已在儲存端新增100G,但是客戶端仍然顯示200G
[root@mdg /]# fdisk -l |grep /dev/mapper/3600a098038303867635d4a48624e5467

Disk /dev/mapper/3600a098038303867635d4a48624e5467: 214.7 GB, 214748364800 bytes
[root@mdg ~]# df -h |grep /u02test
/dev/mapper/3600a098038303867635d4a48624e5467  197G  216M  187G   1% /u02test


--執行resize2fs命令,磁碟新容量300G客戶端仍然顯示200G
[root@mdg /]# resize2fs -help
resize2fs 1.41.12 (17-May-2010)
Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [new_size]
[root@mdg /]# resize2fs /dev/mapper/3600a098038303867635d4a48624e5467 300G
resize2fs 1.41.12 (17-May-2010)
The containing partition (or device) is only 52428800 (4k) blocks.
You requested a new size of 78643200 blocks.
[root@mdg /]# fdisk -l |grep /dev/mapper/3600a098038303867635d4a48624e5467
Disk /dev/mapper/3600a098038303867635d4a48624e5467: 214.7 GB, 214748364800 bytes
[root@mdg ~]# df -h |grep /u02test
/dev/mapper/3600a098038303867635d4a48624e5467  197G  216M  187G   1% /u02test


--重啟後磁碟在客戶端正常顯示300G
[root@mdg /]# reboot
Broadcast message from root@mdg
        (/dev/pts/0) at 14:39 ...
The system is going down for reboot NOW!
[root@mdg /]#
login as: root
root@192.168.8.8's password:
Last login: Wed May 16 14:24:51 2018 from 192.168.1.3
[root@mdg ~]# fdisk -l |grep /dev/mapper/3600a098038303867635d4a48624e5467
Disk /dev/mapper/3600a098038303867635d4a48624e5467: 322.1 GB, 322122547200 bytes

--mount該磁碟,該磁碟已經正常顯示300G,但是mount分割槽仍然顯示200G
[root@mdg ~]# mount /dev/mapper/3600a098038303867635d4a48624e5467 /u02test
[root@mdg ~]# df -h |grep /u02test
/dev/mapper/3600a098038303867635d4a48624e5467  197G  216M  187G   1% /u02test

--執行resize2fs命令,磁碟新容量300G,mount分割槽正常顯示300G
[root@mdg ~]# resize2fs /dev/mapper/3600a098038303867635d4a48624e5467 300G
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/3600a098038303867635d4a48624e5467 is mounted on /u02test; on-line resizing required
old desc_blocks = 13, new_desc_blocks = 19
Performing an on-line resize of /dev/mapper/3600a098038303867635d4a48624e5467 to 78643200 (4k) blocks.
The filesystem on /dev/mapper/3600a098038303867635d4a48624e5467 is now 78643200 blocks long.
[root@mdg ~]# df -h |grep /u02test
/dev/mapper/3600a098038303867635d4a48624e5467  296G  220M  281G   1% /u02test


--檔案沒有丟失檔案沒有損壞
[root@mdg ~]# cd /u02test
[root@mdg u02test]# ll
total 29164
-rw-r--r-- 1 root     root           12 May 16 14:10 123
-rw-r--r-- 1 oracle   dba            12 May 16 14:12 123_2
-rw-r----- 1 orahyprd oinstall  3509831 May 16 14:12 alert_HYPRD.log
-rw-r----- 1 oracle   oinstall 26327331 May 16 14:11 alert_MESDB.log
drwx------ 2 root     root        16384 May 16 13:39 lost+found
[root@mdg u02test]# cat 123
efefasdjlj
[root@mdg u02test]# cat 123_2
efefasdjlj
[root@mdg u02test]# less alert_HYD.log
[root@mdg u02test]# less alert_MDB.log


--實驗過不停往該分割槽複製檔案,可以使用到296G,說明新增容量有效

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2154591/,如需轉載,請註明出處,否則將追究法律責任。

相關文章