After upgrading a Debian system from 5.0 to 6.0 (Lenny to Sqeeze), how do I go about upgrading the root filesystem (which in this case is also boot) from ext3 to ext4?
This was no big deal at all, here's what I did:
/etc/fstab, replacing "ext3" with "ext4" for my root filesystem. (I also removed "barrier=1", which is now the default on ext4.)
- Reboot into single user mode with read only root filesystem.
tune2fs -O extents,uninit_bg,dir_index /dev/DEV
- Reboot, again into single user mode with read only root filesystem. (Observe some mount warnings.)
e2fsck -fDC0 /dev/DEVto patch up the filesystem.
- Reboot normally.
Most of this was taken from here.
additionaly to pauldoo's answer
- you might need to add
rootfstype=ext4to kernel boot options
- if you've converted a fairly old ext2 to ext4, it might be lacking online resize capability with the only solution - create new ext4 fs and then move your files there (sad, but true)
- if you've converted a fairly old ext2 to ext4, you might notice a .journal file at the root. it does not appear on other mount points, since
fsck -fhides it automatically. Sadly it canot do the same to / mount point - you need live cd or any other running system to hide this
PS still actual for wheezy