linux用resize2fs不损失数据更改ext4分区大小及问题汇总

作者:Chilau 发布于:2014-3-10 13:54 分类:linux

有一台android设备的内存卡是ext4格式,需要留出一些空间建一个fat分区,所以需要重新设置大小。

~ # resize2fs /dev/block/mmcblk1p1 7440336

resize2fs 1.41.12 (17-May-2010)
resize2fs: Device or resource busy while trying to open /dev/block/mmcblk1p1

Couldn't find valid filesystem superblock.

说明分区没有被卸载,需要取消挂载


~ # resize2fs /dev/block/mmcblk1p1 7440336
resize2fs 1.41.12 (17-May-2010)
The containing partition (or device) is only 1890048 (4k) blocks.
You requested a new size of 7440336 blocks.

因为df命令里是1K块数量,这里是4K,所以提示不对。

~ # resize2fs /dev/block/mmcblk1p1 1800048
resize2fs 1.41.12 (17-May-2010)
Please run 'e2fsck -f /dev/block/mmcblk1p1' first.

说明硬盘分区有所无,需要先检查和修复


~ # resize2fs /dev/block/mmcblk1p1 1800048
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/block/mmcblk1p1 to 1800048 (4k) blocks.

The filesystem on /dev/block/mmcblk1p1 is now 1800048 blocks long.

成功了!




« android无法安装软件或安装按钮为灰色解决 | Android设置layout_span后TableLayout大小缩小解决»

发表评论: