On to your questions:
Fang: That's a good plan. You'll need to partition the disk first though. Since this will help me answer your question with fudge I'm going to write out a step-wise procedure for you. The keys to the cabinet are black. There is one on the shelf in 115 and one on my former key-ring.
Part one: Prepare the hard disk. You can do this in fang or another machine.
1. Partition the disk. Fang is partitioned as GPT with a BIOS boot partition (you could choose to use MBR though – just adapt these instructions to fdisk). Use gdisk to partition the drive (gdisk /dev/sdX replacing X with the new disk). I recommend that you look though the help before starting (?) as issuing the wrong command here an really ruin your day. Before creating partitions I would print the partition table (it should be blank) to make sure that I'm partitioning the correct disk. I do not remember how exactly to laid out fang. I'm going to assume that I used a BIOS Boot partition, a EFI system partition (future proofing), a 8GB swap partition (2x memory it's a guideline, not a rule), a 20GB root partition and a data partition consuming the remainder of the disk. You may wish to look at fangs current layout first, and adjust this as you see fit. Layout the partitions as follows (note that the text in [] and () is additional information for you, and will not be a part of the interface):
- [EFI System] start: default (should be 2048) end: +100M type: EF00
- [Linux Swap] start: default end: +8G type: 8200
- [Root] start: default end: +20G type: 8300 (the default)
- [Data] start: default end: default type: 8300 (the default)
- [BIOS Boot] start: default (should be 34) end: default type: EF02
Once you're done with that sort the partitions, save and exit. Notice how we created the fist partition last? The reason for that is gdisk like to align partitions on 1MB boundaries which helps with new “Advanced Format” disks, which have 4k sectors (instead of 1/2k sectors). It's easiest to let gdisk do things its way then add the bios boot partition at the end. We need 1k for GRUB, we're giving it close to 1MB, so this works just fine.
2. Format the disk. The BIOS Boot partition is not formatted. The EFI System partition is formatted vfat (mkfs -t vfat), the swap partition is thew swap file system (mkswap) and the other two are ext4 (mkfs -t ext4)
Part two: Copy the data
1. Boot off Hedwig (if you haven't already). 2. Create mount points in /tmp and most the two root file systems 3. Copy the data (cp -a) 4. unmount old disk
Part three: make fang boot
1. Bind mount /dev /sys and /proc into the new volume 2. Chroot in to the new volume 3. fix the fstab.
- You will need to replace the UUID's as they have changed.
- Use blkid to get the new ones (you may need to do this outside of the chroot)
4. run grub-install
- you need to tell it where to install, it will be the root in the new
disk. /dev/sda is an example, but it will vary with the system 5. rebuild the initrd /usr/sbin/update-initramfs -u -k all
Part three: boot an cleanup
1. Boot fang off the new disk, and if it works put everything back together 2. Make sure that the LDAP server (slapd), DNS server (bind) and KDC are
- not* running. If they are you will get some strange complains about
login failures. 3. If you want to make the auth components for fang work:
- copy over /etc/ldap/slapd.d from norberta
- clean out /var/ldap
- start slapd
- wait a few minutes, then test it by doing
- slapcat > file1
- slapcat > file2(on fluffy)
- diff file1 file2 (you should get no output)
- if the test worked, then it's replicating properly and you can start
the KDC.
- For the DNS
- Make the permissions and ownership on /etc/bind match norberta
- Copy over /usr/local/sbin/updatezone.sh (I think that the
name, it will be the only file in that directory – it's a
script that I wrote since the one in the Debian package is busted.) - Adjust the ldap2zone settings in /etc/crond.d to match norberta. - It will create zone files on the hour, once you are sure that it is working start bind.
4. You're done.
Fudge: This is similar to fang above. Your goal here is to make fudge look mostly like hopkirk. So feel free to use hopkirk as your guide and steal some configuration from it. Keep in mind my warning about blindly copying config files and other stuff though. Also note that you can ssh into hedwig, as working in the iLOM for this sucks. As for the VM's on Fudge, there should be the old skeeter, the old Dursley, and one called toby (which can be deleted). There shouldn't be anything else.
Part One: backup
1. Make sure that there is nothing on Fudge that you want to save. 2. Make a copy of fudges ssh keys (/etc/ssh/*key*)
Part Two: Disk setup.
You can actually steal this part pretty much verbatim from part one for fang above. Keep in mind that the swap partition size might be different, check the current fudge config first. Also use hopkirk as your guide for partition sizes. Finally note that fudge has two disks configured as a hardware RAID 1, hopkirk had two disks configured as a software RAID 1, so they will look different (when you do moody, you'll want to setup a software RAID 1 there).
Part Three: Install the Operating System
1. create a mount point in /tmp 2. mount your root partition on your new mount point 3. boot strap the operating system: debootstrap wheezy <mountpoint> 4. rbind mount /dev /sys and /proc into your newly created drive 5. chroot into your newly created drive 6. copy over from hopkirk:
/etc/apt/apt.conf.d/* /etc/apt/sources.lisr.d/* /etc/apt/preferences.d/*
7. delete /etc/sources.list 8. aptitude update 9. install a text editor so you don't go insane 10. set roots password (passwd) 11. create sysadmin and set it's password
- I usually use vipw for this. You will also need vipw -s
- edit /etc/group to put sysadmin in the correct groups (look at
hopkirk, but note that some groups on hopkirk don't exist yet)
- cp -R /etc/skel /home/local/sysadmin
- fix the ownership and permissions on /home/local/sysadmin
- Or you can use the adduser program
12. Setup /etc/network/interfaces (use hopkirk and the old one as your guide) 13. Create /etc/fstab (use hopkirk as your guide), and remember blkid 14. dpkg-reconfigure debconf
- set the priority to low
- leave the interface at default
15. dpkg-reconfigure tzdata
- select America then Toronto as your time zone (unless you want all
of you time stamps in UTC) 16. launch aptitude and do the following:
- install linux-image-amd64
- install grub-pc
- install openssh-server
- install sudo
- look though the recommends on these and add anything else that's
needed (use hopkirk as your guide)
- Mark everything as Automatically installed (M with “— Installed
Packages” selected
- Aptitude will want to purge just about everything right now
- Using hopkirk as your guide select the packages that you
want to keep (+)
- There will be some packages that are marked as automatic on
hopkirk, which fudge want's to delete. Try a + them a M on
these. If fudge still wants to delete them it means that the package that depends on this on on hopkirk isn't yet installed on fudge. Just + it and deal with it later (if you care, you don't have to it's just housekeeping).
17. Copy the ssh keys that you backed up into /etc/ssh 18. Put your ssh key in sysadmins .ssh/authorized_keys 19. Copy over hopkirks /etc/ssh/sshd_config 20. At this point you have a bootable base Operating System installed with an
ssh server. The hard part should be done. Go ahead and reboot the machine (remember to remove the USB key).
Part Four: Final setup
1. Install all packages that are present on hopkirk but not on fudge. You
can skip mdadm though as that is the software RAID, which fudge doesn't need.
2. Do any necessary configuration (there shouldn't be much). 3. Do any housekeeping (check /etc/groups and any installed packages). 4. Transfer over VM's.
- I would do dursley first and test it for a few days to make sure
that it is working and everything is good before moving skeeter
That should be it. Every that I bootstrapped a a machine I usually forgot one of these steps and ended up going back in once or twice (booting off of the USB key) to fix it. It was usually things like setting roots password or configuring /etc/network/interfaces. Needless to say, it was rather annoying.
Good luck with it.
James