LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-13-2012, 01:59 PM   #1
DuttyWine
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
Question Will remote Debian 6 boot ok (after a '/*' mv) what can I do to ensure?


Hello I was working as root on a Debian 6.0.4 Linux 2.6.32-5-amd64 Server (over ssh)

I accidentally moved the entire '/*' filesystem into a subdirectory I was in, leaving the system quite unusable (no commands worked, even with new absoloute path given). (Yes, I learnt a big lesson here, don't use root all the time and be VERY careful with mv & rm etc).

Now after a fix found here (listed below), the system seems ok, sshd, apache2/php5, ls, mv, cp, cron, mount etc.
I have not rebooted it yet.

I just want to know what I can do/check to ensure it will boot (if it ever needs to) with at least working ssh access, becuase I don't have physical access if it does not boot.

This is what I did wrong and the fix:

Code:
srv:/home/username# mv ftproot /* ./
(one accidental space after the 'ftproot')

Command used to fixed it was something like:
Code:
srv:/home/username# /home/username/lib/ld-2.11.3.so --library-path /home/username/lib /home/username/bin/mv /home/username/* /
Thanks!
 
Old 04-13-2012, 05:52 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,973
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Hi, welcome to LQ!

I can't guarantee that it will work, but it looks sane enough,
apart from the fact that a few files/directories that actually belong
in your home will have ended up in / ...

If this is a remote server: does your hoster provide any backup/restore
facilities?


Cheers,
Tink
 
Old 04-13-2012, 06:08 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,206

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Nice.
Note the title of the person that (originally) provided that answer ...
I would expect that ftproot (at least) will also be in the wrong place.

Edit: just noticed the OP used ld.so rather than ld-linux.so; any particular reason ?.

Last edited by syg00; 04-13-2012 at 06:12 PM.
 
Old 04-13-2012, 08:15 PM   #4
DuttyWine
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi thanks it's good to be here!

@both repliers: Yes sorry I ommitted that the home dir files ended up in / but I just moved them back (no filename conflicts with original /* stuff).

@Tinkster: it seemed to work, in that it moved everything from that folder back into /, I could see that with an ls -lA.

My issue is just I am scared that if I reboot it (soon or in the far future) it may not come back up becuase of something I overlooked/do not know about like proc files etc I have no idea really which is why I asked here where I consider there are some people who know a lot more than me about Linux files and the boot process/ssh requirements etc.

The host does not back up this machine automatically, that's down to us really (it is backed up, I would just rather it not have downtime).

@syg00 LOL.
I think I executed ld-2.11.3.so because the original fix command I found on the forum did not work, becuase the executable was a symlink:

Code:
/lib/ld-linux.so.2 -> /lib32/ld-linux.so.2
It gave me an error and I shat myself becuase I did not know what it would be called, I had no working ls.
So in desperation and thinking the system is dead for sure, why not try:

Code:
srv:/home/username# /home/username/lib/ld-*.so --library-path /home/username/lib /home/username/bin/mv /home/username/* /
Which seemed to work (I am not assuming of course, hence this original post).

So overall, any tips to make sure it will boot and run net & sssh etc?
I know that's vague but is there like a checklist or a command I can run to test bootup files/scripts etc or anything?

If not I'll probably reboot it & prepare for the worst at the weekend when there's less load on it to see/fix.

Cheers.
 
Old 04-13-2012, 09:29 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,206

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Fair enough - I should have checked first, before asking.

Can't comment on the general commands, but you'd hope they'd be o.k. As for booting, depends on the loader - presuming (either) grub, you should be o.k. Go get bootinfoscript to see if everything can be found o.k.
 
  


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
How to ensure USB HDD is detectable at boot time ? ranpkri55 Linux - Hardware 7 02-23-2012 03:04 PM
How to ENSURE email delivery ??? entz Linux - Server 8 08-29-2009 10:38 PM
Does a separate boot partition ensure that grub doesn't get deleted easily? samrat_rao Linux - General 1 02-15-2009 02:24 AM
How to ensure paths are set during boot greengrocer Linux - Newbie 3 04-14-2007 12:47 AM
how to ensure only one record exist with the same name. meluser Programming 5 03-18-2003 02:12 PM


All times are GMT -5. The time now is 12:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration