迁移ext3文件系统到ext4文件系统

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

Use blkid to get UUID.

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在关闭ext4.vhdx之前,您需要确保已经停止了任何正在运行的Docker容器。如果您有正在运行的容器,请使用以下命令停止它们: ``` docker stop <container_name> ``` 接下来,您可以按照以下步骤迁移Docker文件夹: 1. 打开PowerShell或命令提示符,并输入以下命令以停止Docker服务: ``` Stop-Service docker ``` 2. 确认Docker服务已停止。您可以通过在PowerShell或命令提示符中输入以下命令来检查服务状态: ``` Get-Service docker ``` 如果服务状态是“已停止”,则可以继续进行下一步。 3. 移动Docker文件夹。默认情况下,Docker文件夹位于C:\ProgramData\Docker目录下。您可以将该文件夹复制到新位置。 4. 打开Docker配置文件(daemon.json)。您可以在C:\ProgramData\Docker\config目录下找到该文件。使用任何文本编辑器打开该文件。 5. 在配置文件中,找到“data-root”属性,并将其值更改为新位置的路径。例如,如果您将Docker文件夹移动到D:\Docker目录下,则应将该属性更改为: ``` "data-root": "D:\\Docker" ``` 6. 保存并关闭配置文件。 7. 启动Docker服务。在PowerShell或命令提示符中输入以下命令: ``` Start-Service docker ``` 8. 检查Docker服务是否已启动。您可以使用以下命令检查服务状态: ``` Get-Service docker ``` 如果服务状态为“正在运行”,则表示您已成功迁移Docker文件夹。 请注意,如果您使用的是Docker桌面版,则无需执行上述步骤。Docker桌面版会自动管理Docker文件夹。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值