LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2013, 08:15 AM   #1
alanps
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Rep: Reputation: 0
Dedicated Server with Linux CentOS corruption


Hello everybody, I'll try to make this as simple as I can, but please be pacient with me, I never used Linux before and everything I know so far it's from Google's search and personal experience with the famous "trial and error".

Last week I was experiencing some issues with MySQL server and one of my dedicated server's hard disk partition. The main partition (where I have MySQL and Linux OS installed) was full, and I tried to free space moving some folders to another partition.

Because of my luck, and negligence, I move the folder "sbin" with another folders (can't remember the name of them) to the "home" partition. For my surprise, when I finished, I tried to access through SSH to my dedicated server (using PuTTY) and when I enter the root password, it says "wrong password". So I freaked out. I restarted the dedicated server, and I receive this error:
http://img18.imageshack.us/img18/781/bs3l.png

I immediately contacted the company that gives me the server but they told me the only thing they can do is restore the server and, of course, format (erase) everything on it.
I really freaked out x1000000, because I use it for work purposes and I didn't make a backup, because I started using it a few weeks ago.

Anyway, this people won't help me to solve my problems, but I started to think a few things about this:

1. Is there any way to format just ONE partition (the server has THREE), install Linux OS in that partition and then fix the issue in the partition where Linux OS corrupted is installed?
#### IN CASE IT IS POSSIBLE ####
How can I do this? Is like Windows like booting a CD and everything else? Can I do this with an external hard disk through USB?

2. Another ideas? Like solving this OS issue without formating and that stuff.

------

As I said, I'm using this server for work purposes and I have tons of clients' files in there, I can't afford such a loss like that, and I refuse to accept that it's the only "possible solution" to format an entire hard disk.

------

LAST ERROR I RECEIVE WHEN INITIATING SERVER:
http://img802.imageshack.us/img802/1484/61r4.png

## SOME INFO ABOUT THE DEDICATED SERVER
Intel Xeon - Linux CentOS 6
Don't know if it has optical drives like CD-RW.
Don-t know if it has USB ports, I think it should.
I have physical access for a limited amount of time, because it's in a private datacenter.

______________________________


I really appreciate your time and help with this.
Thanks a lot.

Hope you can help me.


Bye bye,
Alan.
 
Old 11-13-2013, 11:05 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,300

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
If you've physical access you should be able to boot from a suitable CentOS 6 DVD or USB and use the "rescue" mode, that'll at least let you mount the partitions and give you some form of access to the data. I'd strongly suggest getting the data off onto USB key / hard disk at that point.

Once you're happy that you have the data you want and can access it on another device such as a laptop etc. I'd then suggest having the OS re-installed from scratch.

Ask your hosting company for the specs of the machine, they should advise if there's any optical drives attached. As for USB, I've not seen a server in years that doesn't have at least two.
 
Old 11-13-2013, 11:10 AM   #3
alanps
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TenTenths View Post
If you've physical access you should be able to boot from a suitable CentOS 6 DVD or USB and use the "rescue" mode, that'll at least let you mount the partitions and give you some form of access to the data. I'd strongly suggest getting the data off onto USB key / hard disk at that point.

Once you're happy that you have the data you want and can access it on another device such as a laptop etc. I'd then suggest having the OS re-installed from scratch.

Ask your hosting company for the specs of the machine, they should advise if there's any optical drives attached. As for USB, I've not seen a server in years that doesn't have at least two.
Thanks a lot for your quick reply.

So if I boot the CentOS DVD, I should be able to access the partitions in "rescue" mode?
Even if the OS is corrupted in the server?

Can I simply boot the rescue mode and move the folders I originally moved out of the root?
 
Old 11-13-2013, 11:24 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,300

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
Quote:
Originally Posted by alanps View Post
So if I boot the CentOS DVD, I should be able to access the partitions in "rescue" mode?
Even if the OS is corrupted in the server?
Yes, Rescue Mode boots the OS off the DVD then scans the server for partitions and mounts them in a folder which you can then chroot to and it'll look just like your server.

Quote:
Originally Posted by alanps View Post
Can I simply boot the rescue mode and move the folders I originally moved out of the root?
Once you've access to your data via any method then TAKE A BACKUP!!!!! Then TAKE ANOTHER BACKUP!!!!

Then once you're happy you have the data on some medium you can access then yeah, you can move folders back and then try rebooting the server and cross your fingers
 
Old 11-13-2013, 12:44 PM   #5
alanps
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TenTenths View Post
Yes, Rescue Mode boots the OS off the DVD then scans the server for partitions and mounts them in a folder which you can then chroot to and it'll look just like your server.

Once you've access to your data via any method then TAKE A BACKUP!!!!! Then TAKE ANOTHER BACKUP!!!!

Then once you're happy you have the data on some medium you can access then yeah, you can move folders back and then try rebooting the server and cross your fingers
Oh man you are giving me a lot of hope, you are like me God, Jesus, the Holly Mary and the Twelve Apostles, all together!!!!!!

One last question, you mentioned "..mounts them in a folder which you can then chroot to and it'll look just like your server."
What means "you can then chroot to"?

Thanks a lot for your help, it really helps me, a lot!

Thanks again!
 
Old 11-13-2013, 01:35 PM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,300

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
Dedicated Server with Linux CentOS corruption

at its simpest chroot fakes out the OS to think that the given folder is /

it's kinda easier to see it in action than explain on my phone
 
Old 11-15-2013, 05:19 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
when you boot off the Rescue DVD, the root '/' is naturally on the DVD, but you can (IF the HDD root is ok!) 'chroot' aka 'change root' to the one on the HDD.
Don't do this if the HDD root is corrupt; its pointless.
The Rescue DVD mounts the HDD partitions as just data partitions, so you can work with them using the programs/tools on the DVD.

HTH
 
  


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
Install Asterisk + AsteriskGUI on Centos dedicated web server oscargim Linux - Server 1 04-14-2012 12:15 PM
Dedicated server Centos 5 FFMEPG awww Linux - Hardware 3 03-11-2011 08:44 AM
Mail/ftp/web servers, on VIRTUAL!! dedicated server. Also resource usage. Centos 5. newn Linux - Software 4 07-08-2010 03:55 PM
Utilization of all IP's on my dedicated Server (CentOS 4) bilalinamdar Linux - Newbie 9 02-15-2007 12:05 PM
Dedicated Server with CentOS 4.x and DNS Xoleum Linux - Newbie 3 09-10-2005 03:48 PM


All times are GMT -5. The time now is 10:57 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration