Migrazione ad ext4 in Debian Squeeze
- NON Cambiare /boot !!!!!!!
- Cambiare fstab per montare tutto in ext4
sudo sed -i 's/ext3/ext4/' /etc/fstab
- Updatare l'initrd
sudo update-initramfs -u -k all
- Reboot
sudo reboot
- Verificare che la root sia montata in ext4. Il Filesystem è ancora compatibile ext3, in caso di problemi.
mount | grep ext4
- Abilitare il login root con key da ssh
- Copiare la key per root
- Abilitare ssh al runlevel
sed -i -e "/^~~/ish:S:respawn:/usr/sbin/sshd -Do 'AllowUsers=root'" /etc/inittab telinit q init 1
- Attendere la disconnessione e poi riconnettersi
ssh root@hostname
- Uscire da screen, chiudere tutti i processi inutili
- Montare la root readonly:
mount -o remount,ro /
- Verificare che il filesystem sia davvero readonly
mkdir /tmp/test mkdir: cannot create directory `test': Read-only file system
- Fare check:
fsck.ext3 -pf /dev/md0
- Abilitare estensioni ext4
tune2fs -O extents,uninit_bg,dir_index /dev/md0
- Il filesystem ora NON è più montabile come ext3
- Fare check:
fsck.ext4 -yfD /dev/md0
- Reboot
reboot
- Rimuovere la riga
sudoedit /etc/inittab
sh:S:respawn:/usr/sbin/sshd -Do 'AllowUsers=root'
- Cancellare la key root
Abilitazione extents
Per ogni directory:
export DIRS=" bin boot cdrom etc files home lib media mnt opt root sbin selinux tmp usr var" for DIR in $DIRS; do echo CHANGING $DIR; sudo find $DIR -xdev -type f -print0 | xargs -0 sudo chattr +e; sudo find $DIR -xdev -type d -print0 | xargs -0 sudo chattr +e; done
- sudo reboot
Just a quick note of caution for other antedeluvians. I migrated to ext4 and migrated most of my filesystems back again when I found that dump/restore didn't (yet) support ext4.