Changing the FS Type of the Root Partition
From NAS-Central Buffalo - The Linkstation Wiki
Here's the overview. (Done while logged in as root):
- backup /dev/sda6
- format sda6 as EXT3 (to use as a staging area)
- boot into EM
- copy sda2 partition to a file on sda6
- boot normally
- copy the sda2 image file to a remote machine
- on the remote machine, loop mount the image
- create a tar copy of the contents of that image
- copy the tar file back to the LS-Pro (to sda6)
- boot into EM
- format sda2 as EXT3
- mount sda6 and sda2
- untar the tar file on top of sda2
- boot normally
- put the new kernel in place in /boot
- reboot
- format sda6 as JFS
- restore the contents of sda6 saved in step 1
And the details. (Done as root):
- backup /dev/sda6. (Use whatever technique you prefer.)
- scp -pr /mnt/disk1 remotehost:/temp-dir1
- format sda6 as EXT3 (to use as a staging area)
- umount /mnt/disk1
- mkfs.ext3 /dev/sda6
- change the /etc/fstab entry for /dev/sda6 to ext3
- /dev/sda6 /mnt/disk1 ext3 defaults,noatime,nodiratime 0 0
- (I don't know if noatime and nodiratime are appropriate for ext3)
- mount -t ext3 /mnt/disk1 (to make sure it works)
- boot into EM. (I did this rather than manually rebooting 3 times.)
- cd /boot
- mv rootfs_ok rootfs_booting
- echo '****' > rootfs_booting
- reboot
- copy sda2 partition to a file on sda6
- telnet into LS-Pro (using login 'root')
- mkdir temp1
- mount -t ext3 /dev/sda6 temp1
- dd if=/dev/sda2 of=temp1/part.image
- boot normally
- cd /boot
- mv rootfs_booting rootfs_ok
- echo `date` > rootfs_ok
- reboot
- copy the sda2 image file to a remote machine
- scp /mnt/disk1/part.image remotehost:/temp-dir2
(this may take a while if the image size is large)
- on the remote machine, loop mount the image
- cd /temp-dir2
- mkdir temp3
- mount -t xfs -o loop part.image temp3
- create a tar copy of the contents of that image
- cd temp3
- tar pzcvf ../part.tgz .
- copy the tar file back to the LS-Pro (back on the LS-Pro)
- scp remotehost:/temp-dir2/part.tgz /mnt/disk1
- boot into EM
- cd /boot
- mv rootfs_ok rootfs_booting
- echo '****' > rootfs_booting
- reboot
- format sda2 as EXT3 (the scary part)
- mkfs.ext3 /dev/sda2
- mount sda6 and sda2
- mkdir temp-dir1
- mount -t ext3 /dev/sda6 temp-dir1
- mkdir temp-dir2
- mount -t ext3 /dev/sda2 temp-dir2
- untar the tar file on top of sda2
- cd temp-dir1
- gunzip part.tgz
- cd ../temp-dir2
- tar pxvf ../temp-dir1/part.tar
(I had to explicitly gunzip the file as the busybox tar available in EM can't do it inline)
- boot normally
- cd /boot
- mv rootfs_booting rootfs_ok
- echo `date` > rootfs_ok
- reboot
- put the new kernel in place in /boot
- cd /boot
- cp uImage.buffalo uImage.buffalo-2.6.12.6
- scp remotehost:/where/the/new/kernel/is uImage.buffalo-2.6.22
- cp uImage.buffalo-2.6.22 uImage.buffalo
- cd /lib/modules
- scp -r remotehost:/where/the/modules/are 2.6.22
(I left the old kernel in /boot in case I need to boot back to it)
(Also bring over any modules you may have cross built)
- reboot
- make any offerings deemed necessary and cross fingers
- reboot
(Ideally you are up on the new kernel at this point)
- format sda6 as JFS
- apt-get install jfsutils (if the utils are not already installed)
- umount /mnt/disk1
- mkfs.jfs -c /dev/sda6
- modify the partition type for /dev/sda6 line in /etc/fstab
- /dev/sda6 /mnt/disk1 jfs defaults,noatime,nodiratime 0 2
- (here too, I'm not sure if noatime and nodiratime are appropriate for JFS)
- mount -t jfs /mnt/disk1 (to make sure it works)
(using the '-c' option made this step take several hours)
- restore the contents of sda6 saved in step 1
-
(use your favorite technique)
- scp -pr remotehost:/temp-dir1 /mnt/disk1

