LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-18-2009, 05:30 AM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Rep: Reputation: 30
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

Last edited by qwertyjjj; 08-18-2009 at 09:58 AM.
 
Old 08-18-2009, 11:53 AM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Currumbin Valley, Australia
Distribution: Devuan
Posts: 3,429
Blog Entries: 33

Rep: Reputation: 226Reputation: 226Reputation: 226
Smile 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

Last edited by GlennsPref; 08-18-2009 at 11:58 AM. Reason: swap is static, change it yourself.
 
Old 08-18-2009, 11:57 AM   #3
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
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.
 
Old 08-18-2009, 12:14 PM   #4
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Currumbin Valley, Australia
Distribution: Devuan
Posts: 3,429
Blog Entries: 33

Rep: Reputation: 226Reputation: 226Reputation: 226
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind9 ,host does reslove a dns name but ping says unknown host Byenary Linux - Networking 10 01-12-2011 01:33 AM
try install host ; bind9-host uninstalled , how to undo sudo apt-get install host? shojaru Linux - Newbie 0 06-11-2009 12:45 AM
Establishing a VPN connection (host to host) using IPSec services adithya24 Linux - Networking 9 06-10-2009 08:44 AM
Required to achieve host to host communication via USB file transfer cable may1284 Linux - General 1 03-14-2007 04:02 PM
Resolving <www.some remote host>.... failed: Host not found. koodoo Linux - Newbie 2 06-27-2005 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration