虚拟主机域名注册-常见问题主机租用问题 → 主机租用问题


Linux云主机(VPS)HOME分区扩容操作流程
作者:

以下是linux服务器增加home分区的操作流程,VPS或云主机升级后需要增加home分区大小的,可以按此方法增加。特别提醒:删除分区后一定要先建立分区再保存,删除后点了保存会导致数据丢失,如果对linux不熟悉的,建议提交维护工单我司手工处理,费用40元。该操作有风险,为避免误操作导致数据丢失,操作前请对您的重要数据进行备份!

 

提示:

灰色内容为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删除分区

Selected partition 1 //显示要删除的分区号,因为只有一个分区,所以显示1

Command (m for help):n //输入n新建分区

Command action

e extended

p primary partition (1-4)

//输入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保存设置

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/sdb1sdb1这里指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

 

 

 

 



来源:
阅读:2354
日期:2013-01-06

【 双击滚屏 】 【 推荐朋友 】 【 收藏 】 【 打印 】 【 关闭 】 【 字体: 】 
上一篇:网站弹出QQ中奖信息、广告代码、连接跳到第三方域名处理方法
下一篇:百度和google推广业务怎么开户?
  >> 相关文章