You are not logged in.

#1 2009-07-17 16:19:03

Rognon
Member
Registered: 2006-10-05
Posts: 40

Changing filesystem and repartitioning

Hello there,
I would like to migrate all my partitions (except /boot) from ext3 to ext4. Furthermore, I'm not happy with my partition scheme and would like to change it. I've got two options coming to mind:

1. Backup everything to an external HD, reformat/repartition, move everything back.
2. Do a clean re-install.

What are your thought on those possibilities?

Thanks

Offline

#2 2009-07-18 10:05:44

pkerwien
Member
From: Sweden
Registered: 2009-07-06
Posts: 14

Re: Changing filesystem and repartitioning

You can also migrate from ext3 to ext4 without a reinstallation, but with the drawback that existing files won't use extents.

You need to use the tune2fs and fsck tools in the filesystem, and that filesystem needs to be unmounted. Run:

* 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 -pDf /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)

Last edited by pkerwien (2009-07-18 10:06:15)


Linux is just like an indian tent: no Gates, no Windows and an Apache inside.

Offline

#3 2009-07-18 10:18:23

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Changing filesystem and repartitioning

Your options seem right to me.  Might be easier w/ gparted.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB