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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-02-2014, 03:13 AM
|
#1
|
LQ Newbie
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4
Rep:
|
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.
|
|
|
08-02-2014, 03:24 AM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
Boot from a Live CD and correct your grave mistake.
|
|
|
08-03-2014, 07:57 AM
|
#3
|
LQ Newbie
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4
Original Poster
Rep:
|
Can you please direct me how to do it, I tried accessing it, but could not see any of my files.
|
|
|
08-03-2014, 08:14 AM
|
#4
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by skgs1970
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 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".
|
|
|
08-03-2014, 08:26 AM
|
#5
|
LQ Newbie
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
08-03-2014, 08:33 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,452
|
sorry - late.
|
|
|
08-04-2014, 02:29 AM
|
#7
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by skgs1970
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?
|
|
|
08-04-2014, 12:19 PM
|
#8
|
LQ Newbie
Registered: Aug 2014
Location: INDIA
Distribution: UBUNTU
Posts: 4
Original Poster
Rep:
|
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
|
|
|
08-04-2014, 03:32 PM
|
#9
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
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?
|
|
|
All times are GMT -5. The time now is 04:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|