rebuilding a system remotely?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

rebuilding a system remotely?

Miles Fidelman-3
Hi Folks,

I have two machines sitting in a data center.  One of them, I've just
finished, very carefully, configuring for production use.

The other machine I've used a bit as a sandbox for trying things before
doing them on the production machine - and at this point the sandbox is
pretty well messed up.

I'd like to either
a. rebuild from scratch to Sarge
b. upgrade to a clean testing release.
either way, without a trip to the datacenter to rebuild from a CD.

So... is there some easy way to do a remote rebuild of a machine that
already has a (still) reasonably functioning base system on it?

Thanks for any advice,

Miles Fidelman


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: rebuilding a system remotely?

Roberto C. Sanchez
On Sun, Sep 03, 2006 at 08:56:29PM -0400, Miles Fidelman wrote:

> Hi Folks,
>
> I have two machines sitting in a data center.  One of them, I've just
> finished, very carefully, configuring for production use.
>
> The other machine I've used a bit as a sandbox for trying things before
> doing them on the production machine - and at this point the sandbox is
> pretty well messed up.
>
> I'd like to either
> a. rebuild from scratch to Sarge
> b. upgrade to a clean testing release.
> either way, without a trip to the datacenter to rebuild from a CD.
>
> So... is there some easy way to do a remote rebuild of a machine that
> already has a (still) reasonably functioning base system on it?
>
I did this with a couple of Red Hat servers a few years ago.  They were
located in a server room at the university and I did not have a key, but
wanted to do the rebuild over the weekend to minimize disruption.
Anyhow, what I did was to transfer all necessary data (e.g., home
directories, mail spools, etc, which I don't think are an issue in your
case) to another server.  I then disabled the swap partition and
bootstrapped a base Debian install (*with* ssh, which is not part of the
base install, IIRC) and set the boot loader to look for the kernel in the
new base partition.  I rebooted and logged in to the new Debian base
install.  Then I nuked the rest of the disk (in my case also
repartitioned while the system was running, which is not for the faint
of heart).  I installed a new base system on the newly nuked disk and
reinstalled the boot loader to boot from the new system.  Once that was
done, I nuked the old swap partition back into a swap partition and then
went about installing whatever packages I needed.  Note, that this whole
procedure requires a fair degree of intestinal fortitude and knowing
what you are doing, as one mistake can reneder the system completely
inaccessible by remote means.  If you have any more specific questions,
please let me know.

Regards,

-Roberto

--
Roberto C. Sanchez
http://familiasanchez.net/~roberto

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rebuilding a system remotely? - idea

Alvin Oga

hi ya roberto

> Roberto C. Sanchez wrote:
>
> I did this with a couple of Red Hat servers a few years ago.  They were
> located in a server room at the university and I did not have a key, but
> wanted to do the rebuild over the weekend to minimize disruption.
> Anyhow, what I did was to transfer all necessary data (e.g., home
> directories, mail spools, etc, which I don't think are an issue in your
> case) to another server.  I then disabled the swap partition and
> bootstrapped a base Debian install (*with* ssh, which is not part of the

good idea to use swap .. assuming the system doesn't need it at the time
you nuked it .. and lots of other assumptions .. but it "should" work
and you'd only need about 2-5MB of swap ( any free unused space )
to do rebuild a new box remotely ..

c ya
alvin


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: rebuilding a system remotely?

Ron Johnson
In reply to this post by Miles Fidelman-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Miles Fidelman wrote:

> Hi Folks,
>
> I have two machines sitting in a data center.  One of them, I've just
> finished, very carefully, configuring for production use.
>
> The other machine I've used a bit as a sandbox for trying things before
> doing them on the production machine - and at this point the sandbox is
> pretty well messed up.
>
> I'd like to either
> a. rebuild from scratch to Sarge
> b. upgrade to a clean testing release.
> either way, without a trip to the datacenter to rebuild from a CD.

How "messed up"?  IOW, what if you just started paring away
packages, aggressively making it as *minimal* as possible while
still being able to run ssh.  (From experience, I can tell you that
that's pretty darned small.)

Then, start adding back packages as you see fit.

- --
Ron Johnson, Jr.
Jefferson LA  USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE+4nMS9HxQb37XmcRAmpFAKDehN06/VFJRWlKzuDwpKFJXzauQQCcCs6J
rYSfuA85DLh7IiTni+R/rMo=
=URBV
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: rebuilding a system remotely?

Miles Fidelman-3
Ron Johnson wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Miles Fidelman wrote:
>  
>> Hi Folks,
>>
>> I have two machines sitting in a data center.  One of them, I've just
>> finished, very carefully, configuring for production use.
>>
>> The other machine I've used a bit as a sandbox for trying things before
>> doing them on the production machine - and at this point the sandbox is
>> pretty well messed up.
>>
>> I'd like to either
>> a. rebuild from scratch to Sarge
>> b. upgrade to a clean testing release.
>> either way, without a trip to the datacenter to rebuild from a CD.
>>    
>
> How "messed up"?  IOW, what if you just started paring away
> packages, aggressively making it as *minimal* as possible while
> still being able to run ssh.  (From experience, I can tell you that
> that's pretty darned small.)
>
> Then, start adding back packages as you see fit.
>  
Well... messed up as in the mail system is completely gronked.

Tried removing and purging every vestige of exim, postfix, sendmail,
then reinstalled postfix.  Can't get postfix to start.  Tried purging
postfix and getting exim to run - no dice.  I think, somewhere along the
way, I messed up a dependency.

Sigh....





--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: rebuilding a system remotely?

Ron Johnson
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Miles Fidelman wrote:

> Ron Johnson wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Miles Fidelman wrote:
>>  
>>> Hi Folks,
>>>
>>> I have two machines sitting in a data center.  One of them, I've just
>>> finished, very carefully, configuring for production use.
>>>
>>> The other machine I've used a bit as a sandbox for trying things before
>>> doing them on the production machine - and at this point the sandbox is
>>> pretty well messed up.
>>>
>>> I'd like to either
>>> a. rebuild from scratch to Sarge
>>> b. upgrade to a clean testing release.
>>> either way, without a trip to the datacenter to rebuild from a CD.
>>>    
>>
>> How "messed up"?  IOW, what if you just started paring away
>> packages, aggressively making it as *minimal* as possible while
>> still being able to run ssh.  (From experience, I can tell you that
>> that's pretty darned small.)
>>
>> Then, start adding back packages as you see fit.
>>  
> Well... messed up as in the mail system is completely gronked.
>
> Tried removing and purging every vestige of exim, postfix, sendmail,
> then reinstalled postfix.  Can't get postfix to start.  Tried purging
> postfix and getting exim to run - no dice.  I think, somewhere along the
> way, I messed up a dependency.

What do /var/log/mail.err and /var/log/mail.log look like after the
failed attempt?

Actually, a horked MTA is what my first guess was when I read
"messed up"... :)

I'd install smail and slocate and *purge* any remaining exim &
postfix packages.  After rebuilding the locate DB, manually rm any
remaining files.

- --
Ron Johnson, Jr.
Jefferson LA  USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE+5ErS9HxQb37XmcRAu1PAJ9QgIybgfR0Wy5mmK7qRtxW3IatNQCeJuK5
9LG2IH5SfIZKxMSmJOdEPVI=
=y9ei
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: rebuilding a system remotely?

Miles Fidelman-3
Ron Johnson wrote:

>> Well... messed up as in the mail system is completely gronked.
>>
>> Tried removing and purging every vestige of exim, postfix, sendmail,
>> then reinstalled postfix.  Can't get postfix to start.  Tried purging
>> postfix and getting exim to run - no dice.  I think, somewhere along the
>> way, I messed up a dependency.
>>    
>
> What do /var/log/mail.err and /var/log/mail.log look like after the
> failed attempt?
>  
mail.err - lots of this (after trying to send a message with mail):

Sep  3 19:58:15 server2 sendmail[10271]: NOQUEUE: SYSERR(root):
/etc/mail/sendmail.cf: line 268: service "smtp" unknown: No such file or
directory
Sep  3 19:58:16 server2 sm-mta[10367]: NOQUEUE: SYSERR(root):
/etc/mail/sendmail.cf: line 268: service "smtp" unknown: No such file or
directory
Sep  3 20:07:24 server2 postfix/smtp[11050]: fatal: unknown service:
smtp/tcp
Sep  3 20:08:37 server2 postfix/smtp[11310]: fatal: unknown service:
smtp/tcp
Sep  3 20:15:30 server2 postfix/master[11300]: fatal: getaddrinfo:
Servname not supported for ai_socktype
Sep  3 20:17:28 server2 postfix/postfix-script: fatal: the Postfix mail
system is not running
Sep  3 20:25:43 server2 postfix/master[2760]: fatal: getaddrinfo:
Servname not supported for ai_socktype
Sep  3 20:27:53 server2 postfix/master[2935]: fatal: getaddrinfo:
Servname not supported for ai_socktype
Sep  3 20:28:11 server2 postfix/postfix-script: fatal: the Postfix mail
system is not running

basically the same messages in mail.info and mail.log
> Actually, a horked MTA is what my first guess was when I read
> "messed up"... :)
>  
funny thing, huh:-(

I started out by trying to install webmin, with it's server monitoring
module.  Turns out that it requires the webmin-sendmail module, which in
turn requires sendmail itself.  Seems like the monitoring module picks
up the location of the sendmail executable from the webmin-sendmail
module's config file.  Pretty broken, sigh....  All I wanted to do was
set up a quick and dirty monitor to watch my main machine and email my
cell phone if something goes down.
> I'd install smail and slocate and *purge* any remaining exim &
> postfix packages.  After rebuilding the locate DB, manually rm any
> remaining files.
>  
Before I try this, do the log entries give you and more focused ideas?

Thanks very much!

Miles


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: rebuilding a system remotely? - FIXED

Miles Fidelman-3
In reply to this post by Ron Johnson
Well, didn't install smail (there doesn't seem to be a packaged version).

I did delete everything I could find, and then installed sendmail from
scratch.  Seems to be working, so....

Thanks to all!  And to all a good night (or early morning).

Miles

Ron Johnson wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Miles Fidelman wrote:
>  
>> Ron Johnson wrote:
>>    
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Miles Fidelman wrote:
>>>  
>>>      
>>>> Hi Folks,
>>>>
>>>> I have two machines sitting in a data center.  One of them, I've just
>>>> finished, very carefully, configuring for production use.
>>>>
>>>> The other machine I've used a bit as a sandbox for trying things before
>>>> doing them on the production machine - and at this point the sandbox is
>>>> pretty well messed up.
>>>>
>>>> I'd like to either
>>>> a. rebuild from scratch to Sarge
>>>> b. upgrade to a clean testing release.
>>>> either way, without a trip to the datacenter to rebuild from a CD.
>>>>    
>>>>        
>>> How "messed up"?  IOW, what if you just started paring away
>>> packages, aggressively making it as *minimal* as possible while
>>> still being able to run ssh.  (From experience, I can tell you that
>>> that's pretty darned small.)
>>>
>>> Then, start adding back packages as you see fit.
>>>  
>>>      
>> Well... messed up as in the mail system is completely gronked.
>>
>> Tried removing and purging every vestige of exim, postfix, sendmail,
>> then reinstalled postfix.  Can't get postfix to start.  Tried purging
>> postfix and getting exim to run - no dice.  I think, somewhere along the
>> way, I messed up a dependency.
>>    
>
> What do /var/log/mail.err and /var/log/mail.log look like after the
> failed attempt?
>
> Actually, a horked MTA is what my first guess was when I read
> "messed up"... :)
>
> I'd install smail and slocate and *purge* any remaining exim &
> postfix packages.  After rebuilding the locate DB, manually rm any
> remaining files.
>
> - --
> Ron Johnson, Jr.
> Jefferson LA  USA
>
> Is "common sense" really valid?
> For example, it is "common sense" to white-power racists that
> whites are superior to blacks, and that those with brown skins
> are mud people.
> However, that "common sense" is obviously wrong.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFE+5ErS9HxQb37XmcRAu1PAJ9QgIybgfR0Wy5mmK7qRtxW3IatNQCeJuK5
> 9LG2IH5SfIZKxMSmJOdEPVI=
> =y9ei
> -----END PGP SIGNATURE-----
>
>
>  


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]