LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   host says I have to rebuild (https://www.linuxquestions.org/questions/linux-software-2/host-says-i-have-to-rebuild-748383/)

qwertyjjj 08-18-2009 05:30 AM

host says I have to rebuild
 
Great
So the host my server is with says that due to not installing the correct hard drive originally, they will put a new one in but I have to rebuild.
Can I just copy /etc, /var/log, /var/www, and /usr/local
to the new hard drive and all be running again?
I'm guessing it will involve a reinstall of the software first followed by copying these folders over?
What folders should be copied?
I guess the main question is do I avoid the hassle and leave it at 512Mb RAM and 80Gb hard drive? It is only going to act as a proxy server and I can always increase RAM later or get more servers if needed. I don't think I have any need for the caching functionality of squid as users are going to mainly be using video and I can't cache that much data. Caching webpages will cause minimal performance improvement IMO as everyone will access different sites.

Also, when I rebuild, and extra RAM is added, will the OS increase the swap partition size accordingly?

Quote:

Dear Sir / Madam

Please can you confirm a suitable time for our engineers to remove the 80GB HD and then add the 250GB HD and replace the memory.

Once they have done this you would need to do a rebuild on the new 250GB drive.

We can then attach the 80GB drive as a secondary should you wish to recover some data,

Please confirm your actions.

We apologies for the inconvenience caused.

Regards
Customer Support

GlennsPref 08-18-2009 11:53 AM

tried to hack my way in at times
 
Hi, I've done quite a few installs and tried to hack my way in at times.

Like this...

Code:

Can I just copy /etc, /var/log, /var/www, and /usr/local
to the new hard drive and all be running again?

But I have not had any success that way.

Some times it takes longer to sort out any bugs from older packages if they have been upgraded during install.

After partitioning and formatting the 250Gb drive,

It would not hurt to rsync the directories, for a foundation,

but if /etc is on the same partition as / it will be lost during install.

Same goes for /var/www and /var/log if on the / (root) partition.

I would back them up, and use the files I required as a reference and/or

replacement configs (once the appropriate (desired) packages are installed)

A good place for this would be the /home/<username>/<backup-dir-here> directory if it is on a separate partition from / (root) and /usr (also generally gets formatted, things can get crazy if not)

Then once the server is installed and running, copy the config files to /etc. You won't be able to use all of them, but some of them will certainly save you some time and brain-memory.

Your old programs installed in /usr/local (I have a separate partition for this to) may be rsync 'd saving permissions as it does.

Just some general knowledge about installs.

hope that helps you, regards Glenn

ps, my /etc/fstab file looks like this (just linux)...
Code:

# Entry for /dev/sda6 :
UUID=8f60d791-9082-4a55-b7ff-90767e62c5bc / ext3 relatime 1 1
# Entry for /dev/sda5 :
UUID=668a0c18-9a69-48d8-bc75-a956c8a0fe82 /boot ext3 relatime 1 2
tmpfs /dev/shm tmpfs noatime 0 0
# Entry for /dev/sdb10 :
UUID=2d7c228a-3eba-4b81-8f10-10dd9cfdea17 /home ext3 relatime 1 2
# Entry for /dev/sda13 :
UUID=13e6a9b5-a63a-459f-8132-19502ed2b9ef /home/glenn/local/Archive ext3 relatime 1 2
# Entry for /dev/sdb6 :
UUID=78461ae8-382a-478f-bd11-8ab1f7924997 /home/glenn/local/Music ext3 relatime 1 2
# Entry for /dev/sda8 :
UUID=554c552e-248b-4e62-8166-859a86d0a8f3 /home/glenn/local/vm1 ext3 relatime 1 2
# Entry for /dev/sdb7 :
UUID=04f903de-23c5-425e-907e-8812868038d3 /home/glenn/local/vm2 ext3 relatime 1 2
/dev/cdrom /media/cdrom auto umask=0,users,iocharset=utf8,ro,exec 0 0
/dev/fd0 /media/floppy auto umask=0,users,iocharset=utf8,noauto,exec,flush 0 0
# Entry for /dev/sda1 :
UUID=E098342C98340416 /mnt/win_c ntfs-3g defaults 0 0
UUID=c25946d4-790d-4ca8-8be1-84e56d6b0d54 /opt ext3 relatime 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda10 :
UUID=ba99e8a3-9e8c-430c-b20a-b64377a2155c /tmp ext3 relatime 1 2
# Entry for /dev/sda9 :
UUID=e2db618a-acc5-41b0-a9c9-95035c2df816 /usr ext3 relatime 1 2
# Entry for /dev/sdb11 :
UUID=b2370f30-d7fe-451a-9aec-6b0c009f19e3 /usr/local ext3 relatime 1 2
# Entry for /dev/sda7 :
UUID=024e52ef-71a8-4db4-a562-73ef6b193bdc /var ext3 relatime 1 2
# Entry for /dev/sda12 :
UUID=5456da07-de09-47a1-bd4d-81b2a667e928 /var/ftp ext3 relatime 1 2
# Entry for /dev/sda14 :
UUID=1418aa89-dadb-4bba-92e1-d071bb3430ca /var/spool ext3 defaults 1 2
# Entry for /dev/sdb5 :
UUID=de2163aa-fc11-408a-97a9-15ed1a6fd616 /var/www ext3 relatime 1 2
# Entry for /dev/sdb2 :
UUID=24eda376-9395-4881-a4f6-2e0c6e624b74 swap swap defaults 0 0

I left a few out to save space here, but you see what I mean....

Many config files for users and /root are in their home dirs. Don't forget them.

I think I would ask them to backup the whole 80Gb to /home/....as is.
Code:

will the OS increase the swap partition size accordingly
No. Usually only with a default (clean) install, But you should separate the directories you want to keep separate from / and /usr

Cheers Glenn

qwertyjjj 08-18-2009 11:57 AM

I suppose I could reinstall the programs individually.
To be honest the main things I care about are the conf files. Could I just copy those across?
httpd.conf
squid.conf
ssh.conf or sshd.conf
squid_passwd files
/etc/sysconfig/iptables
/etc/crontab
/etc/cron.daily
any self developed scripts

anything else major?
I guess SARG I just reinstall completely as it's files seem all over the place.

GlennsPref 08-18-2009 12:14 PM

Yes. You could but you may get permission probs with the password file.

use rsync, it keeps the permissions in tact.

But at the same time the rest would only need root access to copy the files accross.

I have a few scripts that automate the process for my system after a clean install.

I break my system all the time, But not the last year or so.

also...

Code:

#! /bin/bash
#rsync -av
#
rsync -av /home/glenn/My_system/backup/GamesBox/etc/sysconfig/network-scripts/chat-ppp0 /etc/sysconfig/network-scripts/chat-ppp0
rsync -av /home/glenn/My_system/backup/GamesBox/etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0
rsync -av /home/glenn/My_system/backup/GamesBox/etc/sysconfig/network-scripts/ifcfg-ppp0 /etc/sysconfig/network-scripts/ifcfg-ppp0
rsync -av /home/glenn/My_system/backup/GamesBox/etc/sysconfig/network-scripts/ifcfg-lo /etc/sysconfig/network-scripts/ifcfg-lo
rsync -av /home/glenn/My_system/backup/GamesBox/etc/sysconfig/network /etc/sysconfig/network
rsync -av /home/glenn/My_system/backup/GamesBox/etc/ppp/peers/ppp0 /etc/ppp/peers/ppp0
rsync -av /home/glenn/My_system/backup/GamesBox/etc/rc.d/init.d/atomic.firewall /etc/rc.d/init.d/atomic.firewall
rsync -av /home/glenn/My_system/backup/GamesBox/etc/rc.d/rc.local /etc/rc.d/rc.local
rsync -av /home/glenn/My_system/backup/GamesBox/etc/shells /etc/shells
rsync -av /home/glenn/My_system/backup/GamesBox/etc/profile /etc/profile
rsync -av /home/glenn/My_system/backup/GamesBox/etc/modprobe.preload /etc/modprobe.preload
rsync -av /home/glenn/My_system/backup/GamesBox/etc/modprobe.conf /etc/modprobe.conf
rsync -av /home/glenn/My_system/backup/GamesBox/etc/hosts.deny /etc/hosts.deny
rsync -av /home/glenn/My_system/backup/GamesBox/etc/hosts.allow /etc/hosts.allow
rsync -av /home/glenn/My_system/backup/GamesBox/etc/hosts /etc/hosts
rsync -av /home/glenn/My_system/backup/GamesBox/etc/sysctl.conf /etc/sysctl.conf
rsync -av /home/glenn/My_system/backup/GamesBox/etc/crontab /etc/crontab
rsync -av /home/glenn/My_system/backup/GamesBox/etc/resolv.conf /etc/resolv.conf
rsync -av /home/glenn/My_system/backup/GamesBox/etc/squid/squid.conf /etc/squid/squid.conf
rsync -av /home/glenn/My_system/backup/GamesBox/etc/security/limits.conf /etc/security/limits.conf
rsync -av /home/glenn/My_system/backup/GamesBox/etc/sysconfig/irqbalance /etc/sysconfig/irqbalance
rsync -av /home/glenn/My_system/backup/GamesBox/etc/mrtg/mrtg.cfg /etc/mrtg/mrtg.cfg

Not sure if centos is rpm based, but if it is you can get a list of installed packages with this...
Code:

sudo rpm --list -qa > /home/glenn/build/rpm-list-qa.txt
The folder you sent it to must exist already.

Regards Glenn


All times are GMT -5. The time now is 07:10 AM.