LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-02-2014, 02:13 AM   #1
skgs1970
LQ Newbie
 
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4

Rep: Reputation: Disabled
Unhappy Accidental moving of root folder --- unable to log in


0 down vote favorite


I was using 12.04 lts as a fileserver(using Samba to access it from windows client machines) for a large amount of documents, and used to add files to it regularly. Yesterday I goofed up, I copied a folder into server, but noticed that I needed to move a directory and few files out to another directory. I moved few files, but while moving the directory, I used the command mv -t /* to my serving directory. This caused instantaneous crashing of my system and when I restarted, it failed to boot completely and got stuck while finding bin/sh while trying to execute the scripts.

Is there a way to recover it, although I have the backup of may be 95% documents in a external HD, I need the rest 5% too.

Please help.
 
Old 08-02-2014, 02:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Boot from a Live CD and correct your grave mistake.
 
Old 08-03-2014, 06:57 AM   #3
skgs1970
LQ Newbie
 
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4

Original Poster
Rep: Reputation: Disabled
Can you please direct me how to do it, I tried accessing it, but could not see any of my files.
 
Old 08-03-2014, 07:14 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by skgs1970 View Post
Can you please direct me how to do it, I tried accessing it, but could not see any of my files.
Next time use "echo" and run something like
Code:
echo "mv -t /* /some/path"
to see what it would do if unsure. Note the
Code:
eval echo "/*"
glob expands to all top level directories so you should look in the first directory in the list (prolly /bin) for those 5% documents you need to salvage. Then restore the system from backup to make certain and re-populate your "serving directory".
 
Old 08-03-2014, 07:26 AM   #5
skgs1970
LQ Newbie
 
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4

Original Poster
Rep: Reputation: Disabled
Ok, will try it. But there is shell access from system only through the live CD. I may need to mount the drive. When i did try to mount it, i was unable to mount it. At least if i could mount it, could have copied all the latest files.
Is there a way to mount my drive. I had used the default option when installing ubuntu, so I have one extended partition and one root partition.
 
Old 08-03-2014, 07:33 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,772

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
sorry - late.
 
Old 08-04-2014, 01:29 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by skgs1970 View Post
I may need to mount the drive. When i did try to mount it, i was unable to mount it.
Might be because a rescue boot enters runlevel 1 and not 3? And please be clear: which drive? What's the mount command? What does "unable to mount" mean? Got any errors?
 
Old 08-04-2014, 11:19 AM   #8
skgs1970
LQ Newbie
 
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you unSpawn for your replies.
/dev/sda1 was the primary partition, which I could mount, but as I moved all the files, there was nothing in it. /dev/sda2 was the swap partition, while /dev/sda5 was extended partition, which had the data. I am not sure about the message now.
Anyways I have resigned to the fact that I have to repopulate my file server from my external backup and hunt for rest of the documents. I need those pdfs and documents for my referencing daily, so have formatted and reinstalled everything.

Thanks again
 
Old 08-04-2014, 02:32 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
I don't understand the problem. You moved the files somewhere, so just boot a live CD, mount all applicable partitions, and move them back. Where's the issue?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to add a folder to apache web root mia_tech Linux - General 4 05-30-2014 12:17 PM
moving files to root folder o-madsen Linux - Newbie 13 05-12-2013 02:59 AM
UNDO or similar for Thuna 1.4.0? Accidental file moving mechagojira Linux - Software 1 05-06-2013 11:13 AM
[SOLVED] root unable to access folder nhelder Linux - Newbie 3 11-29-2010 03:52 PM
unable to log on as root cygnis1 Linux - Newbie 10 10-25-2009 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:32 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
Open Source Consulting | Domain Registration