[clue-tech] New System Configuration
Collins Richey
crichey at gmail.com
Sun Oct 7 14:44:36 MDT 2007
On 10/7/07, Jed S. Baer <cluemail-jsb at freedomsight.net> wrote:
> The other option would be to partition, make the root filesystem and swap,
> write an MBR, and then tar from the old drive to the new one. I'd have to
> boot a live CD to do it, which is no biggie, I guess. What issues would I
> have with this?
>
I've done the equivalent quite a few times, and it's no big deal.
Quite literally, the only problem you'll have is with fixing up
/boot/grub/menu.lst and /etc/fstab. Unbuntu and Debian now use UUID
for everything, and there's one little gotcha waiting in
/boot/grub/menu.lst.
1. use 'blkid /dev/sdxx' (address of the root partition) and again for
the swap partition to get the UUID values for your new partition(s).
2. in /boot/grub/menu.lst, pay attention to the following lines which
look like comments, but trust me they are not. Here's an example from
mine. These will have values for your old disk and you need to modify
them for the new partition.
# kopt=root=UUID=c9cd073d-f3e0-4510-95be-d040d1fd6c6a ro
...
# groot=(hd1,7)
The next time you install a kernel, the update-grub procedure that is
run under the covers will ignore values for your running system and
blindly use these values to reconstruct all boot stanza entries
entries for your Ubuntu system!!! If you didn't change them, you're in
for an ah sh*t - system recovery again.
And, of course, change the grub stanza to boot your new partition.
title Debian GNU/Linux, kernel 2.6.22.9-slh-smp-1 Default
root (hd1,7)
kernel /boot/vmlinuz
root=UUID=c9cd073d-f3e0-4510-95be-d040d1fd6c6a ro quiet vga=791
initrd /boot/initrd.img
3. Finally /etc/fstab. You're beginning to get the picture that UUID
is king in Debian land. RH systems use partition labels for the same
purpose. This is all to get around the problem that the bios may
renumber drives when you add new drives, but the UUID and the labels
remain constant.
# added by rebuildfstab [/dev/sdb8, no label]
UUID=c9cd073d-f3e0-4510-95be-d040d1fd6c6a / ext3
defaults,errors=remount-ro,noatime 0 1
# added by rebuildfstab [/dev/sdb2, no label]
UUID=828865e3-22e4-4a45-a888-c24c08acf341 none swap sw 0 2
4. chroot to your new system and run grub before shutting down.
root=(hdx,y) -> the new /boot partition (ie / if you haven't a separate /boot)
setup (hd0)
quit
Nothing else about your cloned system should need to be changed.
Good luck.
--
Collins Richey
If you fill your heart with regrets of yesterday and the worries
of tomorrow, you have no today to be thankful for.
More information about the clue-tech
mailing list