Alex Suzuki <[EMAIL PROTECTED]> writes: > Maybe I will just buy a new harddrive (I wanted to buy one anyway), > partition it, format it, then copy the stuff, run lilo... bang :) > I guess that's the safest way to upgrade to reiserfs or xfs. > What do you think?
I have been slowly migrating some ext2 systems I manage to xfs. Here is the steps I have been taking. The systems were initially set up with a single /dev/hda1 ext2 partition for everything (plus a small /dev/hda2 partition for swap). 0. Back up /var, /etc, /usr/local and any other directories that can't be recreated with a fresh Debian install. 1. Install your new kernel with xfs or reiserfs support and make sure it actually boots correctly. 2. Boot from a rescue cd that includes the GNU parted program. The rescue cd's kernel doesn't have to be your kernel, and it doesn't need xfs or reiserfs support on it. 3. Run `parted /dev/hda' and do a. print b. resize 1 xxxx 5000 c. rm 2 d. print e. mkpart primary linux-swap yyyy 5256 f. print g. mkpart primary yyyy 10000 This essentially resizes the ext2 filesystem on /dev/hda1 into half, moves the swap partition into the middle of the disk, and creates another partition at the end. The numbers in the example assume the disk is exactly 10GB; YMMV. The value of xxxx is determined from the starting value of the first partition. You can't change the starting value of an ext2 filesystem when you're resizing it. So, if the starting value from print said 0.023, then your xxxx would be 0.023. The value of yyyy is determined by looking at the ending partition numbers from the print and adding 0.1. So, if parted prints that partition 1 goes from 0.023 to 4998.234, then yyyy in step d would be 4998.3. 4. Reboot into single user mode: hit shift at the lilo prompt, and do linux -s, or do a full boot, then do `shutdown now'. 5. Create an xfs filesystem on the new partition and mount it: mkfs.xfs /dev/hda3 mount -t xfs /dev/hda3 /mnt 6. Copy / to the new partition: cd / find . -xdev -print0 | cpio -pvdm0 /mnt 7. Edit /mnt/etc/{fstab,lilo.conf} to represent the fact that the root partition has changed. 8. Install new lilo boot block with the new info: chroot /mnt lilo -v 9. Unmount /mnt, reboot and your system now booting with xfs / filesystem on /dev/hda3. If you don't want to keep your disks partitioned, then you could use parted to resize the partitions again, and use the filesystem resizing tools for xfs (or reiserfs). I've never done that. -- Dave Carrigan ([EMAIL PROTECTED]) | Yow! I'm CONTROLLED by the CIA!! UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | EVERYONE is controlled by the Seattle, WA, USA | CIA!! http://www.rudedog.org/ |