开发者社区> 问答> 正文

根据官方的磁盘扩容教程,看我怎样把主机弄挂的


不知道问题出在哪里,小白~~






Xshell 5 (Build 0556)
Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.


Type `help' to learn how to use Xshell prompt.
[e:\~]$


Connecting to 121.199.9.252:1984...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.


Last login: Tue Apr 28 08:52:12 2015 from 125.120.153.219


Welcome to aliyun Elastic Compute Service!


[root@AY13052909 ~]# df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G  2.9G   16G  16% /
devtmpfs        488M     0  488M   0% /dev
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           497M  6.5M  490M   2% /run
tmpfs           497M     0  497M   0% /sys/fs/cgroup
/dev/xvdb1       20G  1.6G   18G   9% /idata
[root@AY13052909 ~]# /etc/init.d/nginx stop
Stopping nginx!
[root@AY13052909 ~]# /etc/init.d/mysqld stop
Shutting down MySQL..                                      [  OK  ]
[root@AY13052909 ~]# /etc/init.d/php-fpm stop
Gracefully shutting down php-fpm . done
[root@AY13052909 ~]# systemctl stop vsftpd.service
[root@AY13052909 ~]# umount /idata
[root@AY13052909 ~]# df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G  2.9G   16G  16% /
devtmpfs        488M     0  488M   0% /dev
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           497M  6.5M  490M   2% /run
tmpfs           497M     0  497M   0% /sys/fs/cgroup
[root@AY13052909 ~]# fdisk /dev/xvdb
Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.




Command (m for help): d
Selected partition 1
Partition 1 is deleted


Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-58720255, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-58720255, default 58720255):
Using default value 58720255
Partition 1 of type Linux and of size 28 GiB is set


Command (m for help): wq
The partition table has been altered!


Calling ioctl() to re-read partition table.
Syncing disks.
[root@AY13052909 ~]# e2fsck -f /dev/xvdb1
e2fsck 1.42.9 (28-Dec-2013)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/xvdb1


The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>


[root@AY13052909 ~]# resize2fs /dev/xvdb1
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/xvdb1
Couldn't find valid filesystem superblock.
[root@AY13052909 ~]# df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G  2.9G   16G  16% /
devtmpfs        488M     0  488M   0% /dev
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           497M  6.5M  490M   2% /run
tmpfs           497M     0  497M   0% /sys/fs/cgroup
[root@AY13052909 ~]# fdisk -l


Disk /dev/xvda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009e68a


    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *        2048    41943039    20970496   83  Linux


Disk /dev/xvdb: 30.1 GB, 30064771072 bytes, 58720256 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x1aced61c


    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1            2048    58720255    29359104   83  Linux

展开
收起
shuguang 2015-04-28 09:36:32 16073 0
11 条回答
写回答
取消 提交回答
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    阿里云官方的操作指南对于新手一塌糊涂,对于技术来说多余,我按照指南来操作,每一步都出错。
    2016-06-15 16:07:30
    赞同 展开评论 打赏
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    很多教程不适合用于CentOS 7
    2015-10-13 17:13:55
    赞同 展开评论 打赏
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    我也是这么弄挂的!跟你一模一样的问题!不知道是什么情况!还好之前做了快照!
    2015-10-12 03:32:11
    赞同 展开评论 打赏
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    楼主加油
    2015-08-30 12:52:34
    赞同 展开评论 打赏
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    我也遇到跟楼猪一样的错误,请问楼猪最后怎么解决的?
    2015-08-30 11:18:54
    赞同 展开评论 打赏
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    不如单加个数据盘,这么折腾,没太大必要。
    2015-04-28 21:29:25
    赞同 展开评论 打赏
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    哈哈,产品贵在用户体验。
    2015-04-28 13:06:00
    赞同 展开评论 打赏
  • Re回2楼shuguang的帖子
    引用第3楼海曼于2015-04-28 10:41发表的 回2楼shuguang的帖子 :
    这个问题其实昨天我在另外一个账户给官方提议过了.

    官方回复是resize2fs   扩容的话,数据不会丢失的?

    老实说我到现在都不敢去扩容.
    ....... [url=http://bbs.aliyun.com/job.php?action=topost&tid=240380&pid=647735][/url]
    同感啊。
    2015-04-28 11:01:44
    赞同 展开评论 打赏
  • 回2楼shuguang的帖子
    这个问题其实昨天我在另外一个账户给官方提议过了.

    官方回复是resize2fs   扩容的话,数据不会丢失的?

    老实说我到现在都不敢去扩容.

    不知道阿里云到底有木有经过严格的测试.


    而且既然扩容都出来了. 为什么不搞的更省心点儿. 直接后台扩容一次性搞定.


    就如我们的PC上,增加容量也是很容易的. 也不会说会格式化初始化卸载什么的.

    2015-04-28 10:41:10
    赞同 展开评论 打赏
  • Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    centos 7  

    步骤是按官方说的来,结果还是不成功

    数据不多,全部初始化了,哎~

    -------------------------

    Re根据官方的磁盘扩容教程,看我怎样把主机弄挂的
    不知道是不是和4K对齐有什么关系还是怎地,不敢再试了
    2015-04-28 10:33:49
    赞同 展开评论 打赏
  • 旺旺:nectar2。
    楼主您好,

    请问您用的是什么版本的Linux?

    或许可以参考一下这个:http://stackoverflow.com/questions/26305376/resize2fs-bad-magic-number-in-super-block-while-trying-to-open

    祝您早日解决问题。

    -------------------------

    回 2楼(shuguang) 的帖子
    楼主您好,

    之前提供给您的链接页面,大概是说,

    a. CentOS 7 默认使用XFS文件系统
    b. 请确认您的数据盘是使用哪种文件系统,是XFS还是ext3之类的
    c. 如果是XFS文件系统,resize2fs 命令无效,因为 resize2fs 的处理对象是ext2/ext3/ext4文件系统
    d. 如果是XFS系统,或许您需要使用 xfs_growfs 命令来达到类似 resize2fs 的效果

    但千万,千万,操作前,请备份好重要的数据。
    2015-04-28 09:54:23
    赞同 展开评论 打赏
滑动查看更多
问答排行榜
最热
最新

相关电子书

更多
微信SQLite数据库损坏恢复实践 立即下载
Android应用启动速度和内存优化实践 立即下载
Android应用-启动速度和内存优化实践 立即下载