I've got a CentOS server that crashes due to a bad hard disk. I have got a spare disk and need to format and reinstall CentOS from the SERVER CD. Backup and reinstall is a major PITA because of some of the customisations that I've done e.g. the DNS Server is set to log queries (the default does not do this). Any tips on :-
- backing up and reinstalling (is a script available)? - is the SERVER CD still 4.4? - Any suggestions on BIND to log queries without SELINUX throwing a fuss?
Thanks for any help! Josh
josh donovan josh.dvan@yahoo.co.uk escribio (2.9.2008 13:42)
I've got a CentOS server that crashes due to a bad hard disk. I have got a spare disk and need to format and reinstall CentOS from the SERVER CD. Backup and reinstall is a major PITA because of some of the customisations that I've done e.g. the DNS Server is set to log queries (the default does not do this). Any tips on :-
- backing up and reinstalling (is a script available)?
- is the SERVER CD still 4.4?
- Any suggestions on BIND to log queries without SELINUX throwing a fuss?
This may not be directly useful to you.
As a general strategy, I have been thinking of making / and other important partitions (if any) raid1 at system install - even when there is no second disk. Someone just wrote that even the /boot partition can be raid1.
This way it will be easy later to clone the disk. Just bring in a blank disk, format, add to the raid array and let it sync. :-) Then you would still have to install grub, if the disk needs be bootable, but that's fast.
- Jussi
-- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * SMS +358 40 771 2098 jussi.hirvi@greenspot.fi * http://www.greenspot.fi
Jussi Hirvi wrote:
This may not be directly useful to you.
As a general strategy, I have been thinking of making / and other important partitions (if any) raid1 at system install - even when there is no second disk. Someone just wrote that even the /boot partition can be raid1.
Yes, the /boot partition can be md raid. But it can't be LVM. We're using md raid for all server that have no hardware raid controllers. GRUB can be installed on both drives at the same time, no problem.
This way it will be easy later to clone the disk. Just bring in a blank disk, format, add to the raid array and let it sync. :-) Then you would still have to install grub, if the disk needs be bootable, but that's fast.
Good idea and I think it should be no performance problem. But use LVM! Don't do md raid for each partition you need. Make 2 md raids and put LVM on the 2nd (first for /boot) and use logicalvolumes for your partitions...
Yes, the /boot partition can be md raid. But it can't be LVM. We're using md raid for all server that have no hardware raid controllers. GRUB can be installed on both drives at the same time, no problem.
Good idea and I think it should be no performance problem. But use LVM! Don't do md raid for each partition you need. Make 2 md raids and put LVM on the 2nd (first for /boot) and use logicalvolumes for your partitions...
I believe that if /boot is on RAID1, that md partition has to be on one of the first two disks (eg hda, hdb)?
Is there any problem with having /boot on a RAID1 partition across 4 disks as follows?
/boot / (LVM) hda RAID1 RAID5 hdb RAID1 RAID5 hdc RAID1 RAID5 hdd RAID1 RAID5
What about swap? It is best on RAID1, RAID5, LVM, something else or doesn't matter?
Mick
admin wrote:
I believe that if /boot is on RAID1, that md partition has to be on one of the first two disks (eg hda, hdb)?
Is there any problem with having /boot on a RAID1 partition across 4 disks as follows?
/boot / (LVM)
hda RAID1 RAID5 hdb RAID1 RAID5 hdc RAID1 RAID5 hdd RAID1 RAID5
The boot loader (GRUB) must be installed in the MBR on a hard disk from which the BIOS can boot. With 4 disks, you can install GRUB on all disks, so you can boot even if the first 2 disks fail.
I think it doesn't matter if /boot is the first or another md raid device. It just must not be a LVM.
What about swap? It is best on RAID1, RAID5, LVM, something else or doesn't matter?
we're using swap via LVM without any performance problems. but my opinion is if a server begins to swap things will get slow anyway no matter what type of disk you're using for swap (maybe excluding flash drives / ramfs).
Mick _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
josh donovan wrote:
I've got a CentOS server that crashes due to a bad hard disk. I have got a spare disk and need to format and reinstall CentOS from the SERVER CD. Backup and reinstall is a major PITA because of some of the customisations that I've done e.g. the DNS Server is set to log queries (the default does not do this). Any tips on :-
- backing up and reinstalling (is a script available)?
If you want to copy the whole server, use cpio. We use this to convert phys servers to virtual.
find / | cpio -o -Hnewc | ssh -c blowfish <remote server> "cpio -u -i -m -d -Hnewc"
or use the -p switch in cpio for pass-through mode. see the cpio info pages.
You might exclude /dev, /sys/, /proc, etc....
- is the SERVER CD still 4.4?
the one in the web, no. would be difficult to find one... with the cpio trick you dont need a CD to reinstall. just attach the new HD do the runnig server...
but, you might want to use cenots 5? my recommendation at all is to do a fresh cenots 5 install, copy over and merge the configs...
- Any suggestions on BIND to log queries without SELINUX throwing a fuss?
Is selinux obstructing query log? do you use "rndc querylog" to turn it on?
Thanks for any help! Josh
Marco Fretz wrote:
If you want to copy the whole server, use cpio. We use this to convert phys servers to virtual.
find / | cpio -o -Hnewc | ssh -c blowfish <remote server> "cpio -u -i -m -d -Hnewc"
Also you could use dump\restore utilites
mount /dev/hdb1 /mnt/hdb1 cd /mnt/hdb1 dump -0uan -f - /boot | restore -r -f -
http://linuxscrew.com/2007/08/13/move-linux-to-another-hard-drive-dump-resto...
- Any suggestions on BIND to log queries without SELINUX throwing a fuss?
You could use dns logining. some example from one of my servers:
options { ..... };
logging { channel default_log { file "/var/log/named.log" size 50000k; severity info; print-time yes; print-category yes; print-severity yes; }; channel more_log { file "/var/log/named_extend.log" size 20000k; severity info; print-time yes; print-category yes; print-severity yes; };
category default { default_log; }; category xfer-in { default_log; }; category xfer-out { default_log; }; category notify { default_log; }; category network { default_log; };
category security { more_log; }; category resolver { more_log; }; category client { more_log; }; category unmatched { more_log; }; category database { more_log; }; category lame-servers { null; }; category queries { more_log;}; };