网上有很多EXT3转换成EXT4的文章,不管什么语言,操作命令都是一样的,原文如下加上我理解的翻译内容
You need to use the tune2fs and fsck tools in the filesystem, and that filesystem needs to be unmounted. Run:
你须要在你的文件系统上运用tune2fs和fsck工具,并且必须卸载文件系统,运行以下命令
-
tune2fs -O extents,uninit_bg,dir_index /dev/yourfilesystem
After running this command you MUST run fsck. If you don't do it, Ext4 WILL NOT MOUNT your filesystem. This fsck run is needed to return the filesystem to a consistent state. It WILL tell you that it finds checksum errors in the group descriptors - it's expected, and it's exactly what it needs to be rebuilt to be able to mount it as Ext4, so don't get surprised by them. Since each time it finds one of those errors it asks you what to do, always say YES. If you don't want to be asked, add the "-p" parameter to the fsck command, it means "automatic repair":
当运行以上命令后你必须运行fsck,如果你不执行以下命令,EXT4将不能挂载到你的文件系统,fsck需要返回文件系统的一致状态,它会返回所找到及检验时的错误,并在须要的时候重建它,以便它能挂载到EXT4,所以不要奇怪,每当发现错误时,他会提示你要做什么,基本上都是重复的回答YES,如果你要取法提示让它自己回复提示,在fsck后台加 -p 参数,表示自动修复
-
fsck -pf /dev/yourfilesystem
There's another thing that must be mentioned. All your existing files will continue using the old indirect mapping to map all the blocks of data. The online defrag tool will be able to migrate each one of those files to a extent format (using a ioctl that tells the filesystem to rewrite the file with the extent format; you can use it safely while you're using the filesystem normally)
这里有个事要说一下,所有您现有的文件将继续使用旧的文件系统或间接映射到新的数据块,联机碎片整理工具将能够迁移每一个档案到设计的范围,(使用ioctl告诉重写的文件的设计范围,当你正常使用你的文件系统时,你可以安全的用它)
在上述命令中的yourfilesystem 表示你所用的的分区,比如我用的是sda9则命令分别是tune2fs -O extents,uninit_bg,dir_index /dev/sda9和fsck -pf /dev/sda9
须要注意的是,你一定要先确定fsck和tune2fs,否则,你的系统会出问题的,而我就是这样一个先例,我没有安装fsck,当我运行tune2fs -O extents,uninit_bg,dir_index /dev/sda9后居然发现fsck没装,而系统要我运行f2fsck,结果系统挂掉了,我操!!
还有,网上说无损转换有些EXT4的特性无法使用,不知道 是什么特性
