Koozali.org: home of the SME Server

how to change local ip address console broke [SOLVED]

Offline axessit

  • ****
  • 211
  • +0/-0
how to change local ip address console broke [SOLVED]
« on: June 18, 2016, 03:26:47 AM »
I have a broken server, and I have backup up the data (manually) and restored onto another hardware box. The new box is running fine (restored everything from backup) but there are some files and settings for contribs not yet installed, so I would like to try and get he old server up and running, however the console programme does not run - ie I log in (on the actual hardware console) with user admin, then it kicks me straight back out. I log in using root, then run console, and get the screen cleared and back to a # prompt. Can I force the system to run the configuration wizard from the command line so I can reconfigure the IP addresses and put into server only mode ?

Also, can I set something to stop it trying to force the filesystem check when it boots ? I know the hard drive has Smart errors and the main root filesystem is not clean, but I am happy not to check it, otherwise the reboots just don't work, having left it for days to do fsck etc.
« Last Edit: June 19, 2016, 12:27:40 PM by axessit »

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: how to change local ip address console broke
« Reply #1 on: June 18, 2016, 06:47:21 AM »
Run signal-event post-upgrade; signal-event reboot

Then try again to access to the console.


For your drive you should take action now.  If you have an installation with a degraded array, i suggest you to add one more drive (EXACT same size or bigger)  then go to the console to manage raid.
Once it has synced, stop the server and remove the old one. Optionally add a new one.

If no raid, then you could do a copy with ddrescue from the disc to another one

Smart error means your drive can fails completely any time without notice, leaving you the burden of paying an expensive  company to get your data
« Last Edit: June 18, 2016, 06:53:50 AM by Jean-Philippe Pialasse »

Offline axessit

  • ****
  • 211
  • +0/-0
Re: how to change local ip address console broke
« Reply #2 on: June 18, 2016, 07:09:45 AM »
I have taken action now, I have the data backed up onto a new machine, new hard drives etc. as I stated. I have used a live CD to boot up and copy the data to get around the forced filesystem check, but I have limited functionality on the old server, as I said. I tried changing the configuration db LocalIP directly by editing the configuration file via the live CD, but there must be more to it. I have already tried the signal-event post-upgrade etc.

I am simply trying to get the local IP changed so I can run the two servers on the same LAN as I had been doing, but restoring the backup sets the new server the same as the old one (and I need it that way for routing rules on the internet firewall).



 

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: how to change local ip address console broke
« Reply #3 on: June 18, 2016, 07:29:43 AM »
why and what for do you want to keep running the old server in the first place with a broken disk?

if the signal event is not enought to get access to the console then you either have corrupt your e-smith db, or the damages on the disk have altered files that are used by the console.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: how to change local ip address console broke
« Reply #4 on: June 18, 2016, 03:39:39 PM »
However the console programme does not run - ie I log in (on the actual hardware console) with user admin, then it kicks me straight back out. I log in using root, then run console, and get the screen cleared and back to a # prompt.

You'll need to diagnose why that is happening, and fix whatever the problem is. You might find some error messages being logged in /var/log/messages.

Offline axessit

  • ****
  • 211
  • +0/-0
Re: how to change local ip address console broke
« Reply #5 on: June 19, 2016, 05:08:51 AM »
Quote
why and what for do you want to keep running the old server in the first place with a broken disk?
as I said in my OP
Quote
there are some files and settings for contribs not yet installed, so I would like to try and get he old server up and running

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: how to change local ip address console broke
« Reply #6 on: June 19, 2016, 07:18:49 AM »
axessit

Rather than trying to retrieve data at this point in time, you should be running a full diagnostic test of the disk & repairing any errors.

Connect the old servers "faulty" disk to your newly built server (as a second SATA drive) & test that way.
You can also download & use the UBCD or burn it to USB & test using that, or download the manufacturers hard disk test software.

Then if that "faulty" disk is looking better ie no more errors, think about reconnecting it to the original server, doing a full backup (using the SME built in backup routines) & then restore everything (including base configuration & contrib configuration) to the new server. You have a spare manual data backup already just in case.

Where is your normal daily full system backup done using SME server backup routines ? You can restore everything to that before the disk problem arose. No backup, tch tch tch !
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline axessit

  • ****
  • 211
  • +0/-0
Re: how to change local ip address console broke
« Reply #7 on: June 19, 2016, 08:19:00 AM »
Yep been booting via a liveCD and copying files as I said in my OP. Just seems crazy that everytime someone suggests something like running fsck etc, whenever I reboot the server, the "EXT3-fs mounted filesystem is mounted with ordered data" yet it still forces a file system check on boot, and that takes DAYS to complete, if it completes. Last time I let it run, it finished and suggested a manual fsck, which I did (and it took over a day) and still produced problems, and got stuck in this loop. Just trying to use some gui tools to check some settings etc and scroll through logs rather than having to page through lengthy screens via the text console, as not all contribs working on the new version (like dansguardian pam auth) and automatic proxy distribution for web browsers, and changing monitor plugs around. I have a laptop, and an all-in-one desktop machine already on the desk, and the server(s) which don't normally require a monitor, so deskspace is getting tight.

Yes backups would be great if they actually restore all the contribs properly, but they don't. Trying to find out some file permissions on some customised files using a third party boot disk is hard when all the file and group owners are just raw numbers.

Don't worry about his anymore, I have all the main things working, the rest is not urgent. Just thought my first simple question of how to change the IPaddress via command line would have been easy, but it appears not to be the case. Probably why no-one has answered that question. Instead I got all the answers I already knew (like booting from Live CDs, that don't give me a gui as my server doesn't seem to allow any of them to start [HP ML110 G4 server]) and I thought I could save some of my limited time to get things pretty again.

Offline axessit

  • ****
  • 211
  • +0/-0
Re: how to change local ip address console broke [solved]
« Reply #8 on: June 19, 2016, 12:27:14 PM »
Booted from a partition magic live CD, and while I have been busy copying files back and forth, noticed that in the background it synched up the raid disks with one that would not synch earlier - I guess all the files were off line, so it worked a treat. Was then able to remove the faulty disk, and the raid booted from the newly synched disk no worries. Then edited the db file with the new IP, signal-event post-upgrade and reboot and everything booted fine. Now just the problem of the console. Nothing on the var/log/messages file. But anyway, not concerned about any of that now, can get at the files.

..now to get dansguardian working on the new server...
« Last Edit: June 20, 2016, 05:38:56 AM by axessit »

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: how to change local ip address console broke [SOLVED]
« Reply #9 on: June 20, 2016, 05:01:44 AM »
the restore should restore all templated contribs, except the rpm of the contribs, you should put them back yourself..
another exception if you save something outside of the backuped paths.

        'home/e-smith',
        'etc/e-smith/templates-custom',
        'etc/e-smith/templates-user-custom',
        'etc/ssh',
        'root',
        'etc/sudoers',
        'etc/passwd',
        'etc/shadow',
        'etc/group',
        'etc/gshadow',
        'etc/samba/secrets.tdb',
        'etc/samba/smbpasswd',


in the case of dansguardian that is true that some of the files are edited manually and should be backed-up too.

changing ip is easy unless your disk is dying like in your case. This leaves unexpected result. To my experience when SMART send alert and you are asked to run fsck it ias too late to do anything else with the disk than a last ddrescue on a same size or bigger drive before throwing it.