Linux云主機(jī)(VPS)HOME分區(qū)擴(kuò)容操作流程- 主機(jī)租用,虛擬主機(jī)域名注冊(cè)-常見問題,虛擬主機(jī),網(wǎng)頁制作,域名注冊(cè),主機(jī),企業(yè)郵局,主頁空間,個(gè)人主頁,網(wǎng)絡(luò)實(shí)名,主機(jī)托管,網(wǎng)站建設(shè),域名">
歡迎您來到禾城數(shù)碼,開始互聯(lián)網(wǎng)之旅!
Linux云主機(jī)(VPS)HOME分區(qū)擴(kuò)容操作流程以下是linux服務(wù)器增加home分區(qū)的操作流程,VPS或云主機(jī)升級(jí)后需要增加home分區(qū)大小的,可以按此方法增加。特別提醒:刪除分區(qū)后一定要先建立分區(qū)再保存,刪除后點(diǎn)了保存會(huì)導(dǎo)致數(shù)據(jù)丟失,如果對(duì)linux不熟悉的,建議提交維護(hù)工單我司手工處理,費(fèi)用30元。該操作有風(fēng)險(xiǎn),為避免誤操作導(dǎo)致數(shù)據(jù)丟失,操作前請(qǐng)對(duì)您的重要數(shù)據(jù)進(jìn)行備份!
提示: 灰色內(nèi)容為linux系統(tǒng)顯示 紅色內(nèi)容為輸入的命令 //綠色內(nèi)容為命令或顯示內(nèi)容說明
[root@west5066 ~]# df -lh //查看home分區(qū)所在的硬盤名稱,我司一般是sdb 文件系統(tǒng) 容量 已用 可用 已用% 掛載點(diǎn) /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 請(qǐng)確認(rèn)home分區(qū)對(duì)應(yīng)的硬盤名稱,以免誤刪其他分區(qū)!
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刪除分區(qū) Selected partition 1 //顯示要?jiǎng)h除的分區(qū)號(hào),因?yàn)橹挥幸粋(gè)分區(qū),所以顯示1
Command (m for help): n //輸入n新建分區(qū) Command action e extended p primary partition (1-4) p //輸入p,選擇要操作的項(xiàng)目 Partition number (1-4): 1 //輸入要新建的分區(qū)號(hào),這里輸入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保存設(shè)置 The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: 設(shè)備或資源忙. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@west5066 ~]# reboot //輸入reboot重啟服務(wù)器
重啟服務(wù)器后執(zhí)行以下命令:
[root@west5066 ~]# resize2fs -f /dev/sdb1 //輸入resize2fs -f /dev/sdb1,sdb1這里指home分區(qū)對(duì)應(yīng)的硬盤分區(qū)名稱 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分區(qū)大小,可以看到已經(jīng)增加了。 文件系統(tǒng) 容量 已用 可用 已用% 掛載點(diǎn) /dev/sda1 9.7G 2.6G 6.7G 28% / tmpfs 252M 0 252M 0% /dev/shm /dev/sdb1 20G 177M 19G 1% /home
|
|||
>> 相關(guān)文章 | |||
|