Convert ext3 to ext4 File system

本文介绍如何将现有的Ext3文件系统转换为Ext4文件系统,包括转换步骤、注意事项及引导加载程序配置更新等内容。

Convert ext3 to ext4 File system

Saturday, January 24th, 2009

ext4 Filesystem Features

The ext4 filesystem has more features and generally better performance than ext3, which is showing its age in the Linux filesystem world. Features include:

Delayed allocation & mballoc allocator for better on-disk allocation

  • Sub-second timestamps
  • Space preallocation
  • Journal checksumming
  • Large (>2T) file support
  • Large (>16T) filesystem support
  • Defragmentation support

WARNING! Once you run following commands, the filesystem will no longer be mountable using the ext3. Please note that ext4 may have some bugs so do not use for production servers (wait for sometime watch Linux kernel mailing list for ext4 bugs). It’s recommended that you keep /boot in a ext3 partition for sometime.

You need ext4 patch applied into kernel and compile kernel with ext4 support. Once done type the following command to convert an existing ext3 filesystem to use ext4, type:
# tune2fs -O extents,uninit_bg,dir_index /dev/dev-name
For example convert /dev/sdb1 to ext4, enter:
# cd /; umount /dev/sdb1
# tune2fs -O extents,uninit_bg,dir_index /dev/sdb1

Next run fsck, enter:
# fsck -pf /dev/sdb1

How do I mount ext4 partition?

mount -t ext4 /dev/sdb1 /path
mount -t ext4 /dev/sdb1 /share
mount -t ext4 /dev/disk/by-uuid/YOUR-PARTITION-UUID /share

How do I boot from ext4 (/boot)?

If you have converted /boot file system (or / used for /boot), update /boot/grub.conf (/boot/grub/menu.lst). Open file and find out current kernel config file and append the following:
rootfstype=ext4
Here is sample config (note I’ve custom kernel names):

title		Ubuntu 8.10, kernel 2.6.28.1-vmware-guest-server
root (hd0,1)
kernel /boot/vmlinuz-2.6.28.1-vmware-guest-server root=UUID=8c2da865-13f4-47a2-9c92-2f31738469e8 ro quiet splash rootfstype=ext4
initrd /boot/initrd.img-2.6.28.1-vmware-guest-server
quiet

Save and close the file. And run update-grub:
$ sudo update-grub
Next, update your /etc/fstab file so that it can be mounted as ext4 file system:

UUID=41c22818-fbad-4da6-8196-c816df0b7aa8 /share ext4 defaults,errors=remount-ro,relatime 0 1

Finally, reboot the system:

$ sudo reboot



Re: Grub legacy now support ext4

I'm using ext4 in the full hard drive ' /' and work well.

The steps I made:


Code:
sudo apt-get update
sudo apt-get dist-upgrade

Download the ISO of the last svn partition manager that support ext4
http://beefdrapes.partedmagic.com/

Burn intro cd/usb-> run It and select: Console

( note: is needed this two comands)
Code:
tune2fs -O extents,uninit_bg,dir_index /dev/yourfilesystem
fsck -pf /dev/yourfilesystem
Done, now your file system is in ext4, but to boot it's need some changes:


Code:
mkdir drive
mount -t ext4 /dev/yourfilesystem drive/
cd drive
vi etc/fstab
change in fstab from ext3 to ext4 (in yourfilesystem)


Code:
vi boot/grub/menu.list
And add this rootfstype=ext4
Code:
# kopt=root=UUID=24c707be-c824-4781-89bd-25ed9dba54f8 ro rootfstype=ext4
...
...
kernel /boot/vmlinuz-2.6.28-4-generic UUID=24c707be-c824-4781-89bd-25ed9dba54f8 ro rootfstype=ext4 quiet splash
Code:
reboot
done

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)
__________________
Marco Sousa Register User Linux #415118
InfoNoticias.eu
Ubuntu 9.04 (Jaunty) Release on April 23, 2009

Last edited by int; 3 Weeks Ago at 07:46 AM..
V27960021@dg03podv27960021kj4p:~/存储/casio/24608/存储2$ python storage.py ./测试 ./对比 24608_report_dual.xlsx 成功创建子目录对比页: system 成功创建子目录对比页: system_apex 成功创建子目录对比页: system_app 成功创建子目录对比页: system_xiangxi 成功创建子目录对比页: system_priv-app 成功创建子目录对比页: system_lib 成功创建子目录对比页: system_lib64 成功创建子目录对比页: system_etc 成功创建子目录对比页: system_framework 成功创建子目录对比页: system_fonts 成功创建子目录对比页: system_product 成功创建子目录对比页: system_ext 成功创建子目录对比页: system_ext_app 成功创建子目录对比页: system_ext_xiangxi 成功创建子目录对比页: system_ext_lib 成功创建子目录对比页: system_ext_lib64 成功创建子目录对比页: system_ext_etc 成功创建子目录对比页: system_ext_media 成功创建子目录对比页: vendor 成功创建子目录对比页: vendor_app 成功创建子目录对比页: vendor_xiangxi 成功创建子目录对比页: vendor_lib 成功创建子目录对比页: vendor_lib64 成功创建子目录对比页: vendor_etc 成功创建子目录对比页: vendor_bin Traceback (most recent call last): File "storage.py", line 215, in <module> generate_all_sheets(args.output, args.folder1, args.folder2) File "storage.py", line 195, in generate_all_sheets generate_directory_detail_sheet(wb, folder1, folder2, prefix, partition, suffix) File "storage.py", line 111, in generate_directory_detail_sheet data1 = parse_du_file(file1_path) File "storage.py", line 67, in parse_du_file size = float(size_str) / 1024.0 ValueError: could not convert string to float: du:
最新发布
11-07
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值