Linux云主機(VPS)HOME分區擴容操作流程- 主機租用,虛擬主機域名注冊-常見問題,虛擬主機,網頁制作,域名注冊,主機,企業郵局,主頁空間,個人主頁,網絡實名,主機托管,網站建設,域名">
Linux云主機(VPS)HOME分區擴容操作流程以下是linux服務器增加home分區的操作流程,VPS或云主機升級后需要增加home分區大小的,可以按此方法增加。特別提醒:刪除分區后一定要先建立分區再保存,刪除后點了保存會導致數據丟失,如果對linux不熟悉的,建議提交維護工單我司手工處理,費用30元。該操作有風險,為避免誤操作導致數據丟失,操作前請對您的重要數據進行備份!
提示: 灰色內容為linux系統顯示 紅色內容為輸入的命令 //綠色內容為命令或顯示內容說明
[root@west5066 ~]# df -lh //查看home分區所在的硬盤名稱,我司一般是sdb 文件系統 容量 已用 可用 已用% 掛載點 /dev/sda1 9.7G 2.6G 6.7G 28% / tmpfs 252M 0 252M 0% /dev/shm /dev/sdb1 9.9G 172M 9.2G 2% /home
[root@west5066 ~]# fdisk /dev/sdb //輸入fdisk /dev/sdb 請確認home分區對應的硬盤名稱,以免誤刪其他分區!
The number of cylinders for this disk is set to 41610. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): d //輸入d刪除分區 Selected partition 1 //顯示要刪除的分區號,因為只有一個分區,所以顯示1
Command (m for help): n //輸入n新建分區 Command action e extended p primary partition (1-4) p //輸入p,選擇要操作的項目 Partition number (1-4): 1 //輸入要新建的分區號,這里輸入1 First cylinder (1-41610, default 1): //選擇要截止的磁盤位置,這里直接按回車,全部增加。 Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-41610, default 41610): //直接按回車。 Using default value 41610
Command (m for help): w //輸入w保存設置 The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: 設備或資源忙. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@west5066 ~]# reboot //輸入reboot重啟服務器
重啟服務器后執行以下命令:
[root@west5066 ~]# resize2fs -f /dev/sdb1 //輸入resize2fs -f /dev/sdb1,sdb1這里指home分區對應的硬盤分區名稱 resize2fs 1.39 (29-May-2006) Filesystem at /dev/sdb1 is mounted on /home; on-line resizing required Performing an on-line resize of /dev/sdb1 to 5242852 (4k) blocks. The filesystem on /dev/sdb1 is now 5242852 blocks long.
[root@west5066 ~]# df –lh //再用df –lh 查詢下home分區大小,可以看到已經增加了。 文件系統 容量 已用 可用 已用% 掛載點 /dev/sda1 9.7G 2.6G 6.7G 28% / tmpfs 252M 0 252M 0% /dev/shm /dev/sdb1 20G 177M 19G 1% /home
|
|||
>> 相關文章 | |||