Converting File Systems - Paiet/Tech-Journal-for-Everything GitHub Wiki
- Create an EXT2 file system
fdisk /dev/sdb
mkfs.ext2 /dev/sdb1
- Convert to EXT3
tune2fs -j /dev/sdb1
- Can be done online, but a remount is typically required to take advantage of new features
- Convert to EXT4
- For live file systems
- Change FSTAB entry to show EXT4
- EXT3 can be mounted as EXT4
sudo vi /etc/fastab
- Boot to single-user mode
- Mount the file system read-only
sudo mount -o remount,ro /
- Continue with the steps for non-live file sytems
- For non-live file systems
- Unmount the volume
- Convert the volume
-
sudo fsck.ext3 -pf /dev/sdb1
- Backup and hide the journal
-
tune2fs -O extents,uninit_bg,dir_index /dev/sdb1
- Enable EXT4 features
- extents replaces bitmapping
- uninit_bg allows file checking in the background, resulting in faster checks
- dir_index enables hashed B-Trees for faster file lookups
-
fsck.ext4 -yfD /dev/sdb1
- Edit FSTAB to show EXT4
- Only new files will use extents
- Old files still stored in bitmaps
- Use
chattr +e <file>
-
lsattr <file>
and look for "e"
- Convert to XFS
- No supported method
- Create a new volume and copy the data over
- Steps
mkfs.xfs /dev/sdc1
mount /dev/sdc1 /mnt/temp
cp -R /website /mnt/temp
umount /website /mnt/temp
mount /dev/sdc1 /website
- Convert to BTRFS
- Similar to XFS in that it is not supported
mkfs.btrfs /dev/sdd1
mount /dev/sdd1 /mnt/temp
cp -R /website /mnt/temp
umount /website /mnt/temp
mount /dev/sdd1 /website
- Add storage
btrfs device add /dev/sde1 /mnt/temp
btrfs filesystem balance /mnt/temp
⚠️ **GitHub.com Fallback** ⚠️