LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-11-2017, 12:47 PM   #1
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,807

Rep: Reputation: 215Reputation: 215Reputation: 215
rm -rf command removed /home files


I have backup but...

I intended to use the command
Code:
rm -rf ~/.sane/xsane/
to reset Xsane to its default settings, but put in an extra space and wrote
Code:
rm -rf ~/ .sane/xsane/
.

This seems to have removed all the files and settings in /home. I now boot into openSUSE 42.1 with everything as if I had just installed 42.1.

I haven’t written to my HDD and can clone all of it or the /home partition with dd, but I don't know if I can then restore /home with something like extundelete or should try to recover files with TestDisk or PhotoRec. /home is on its own ext4 logical partition.

Any advice will be received with all wishes of Karma for the sender.

Last edited by thorkelljarl; 03-11-2017 at 01:50 PM.
 
Old 03-11-2017, 01:00 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
I'm sorry to hear that.

When you say that you have "backup", what does that mean? Do you have a backup of your entire home folder or partition somewhere? How old is that backup?
 
Old 03-11-2017, 01:47 PM   #3
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,807

Original Poster
Rep: Reputation: 215Reputation: 215Reputation: 215
Backup...

I have copies of the files that were stored in the various folders in /home on an external HDD, but not a backup such as with the program Back in Time. It is inconvenient but not fatal that my bookmarks and the settings for /home are not at hand.
 
Old 03-11-2017, 01:58 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,264
Blog Entries: 10

Rep: Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172Reputation: 5172
most important thing: shut down the machine IMMEDIATELY and recover the data from the outside, i.e. booting from a live usb stick.
 
1 members found this post helpful.
Old 03-11-2017, 03:58 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Unfortunately, Linux did exactly what you told it to do. I hate it when it does that!

Certainly, do not write anything to the harddrive (intentionally - there's lots of writing that is beyond your control). And shut it down (cleanly) as soon as possible. Boot from a LiveCD - my preference is "SysRescueCD". Mount the harddrive you are recovering from as read-only. After that, try the "photorec" command. Make sure anything recovered by photorec is written to a different device (not the harddrive you are trying to recover from - if you have mounted it read-only as I mentioned, you would be protected already).

If photorec doesn't save you, there's not much left, in the "easy" department, except going to your backups and recovering as much from there as possible. There are other file recovery things you could try, but they get involved and complicated, and probably aren't worth it in your case, since you have backups you can fall back to instead.
 
Old 03-11-2017, 09:19 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,522

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619
well NEXT time you will READ what you typed before hitting <enter> !!!
 
  


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
[SOLVED] accidentally removed files with mv command monkeyslut Linux - Newbie 9 08-31-2014 08:44 PM
How to recover my home directory which I accidentally removed using rm -rf command? shikshit.hep Linux - Software 6 10-05-2010 03:12 AM
removed all the files from /home folder.tried recovering with foremost.xsession erro harif.konndeth Linux - Newbie 6 09-16-2010 06:48 AM
cp command Howto copy files from /home of one distro to another in a multiboot mach borgibo Linux - Newbie 12 06-08-2009 08:39 AM
removed by mistake /home any possibility to get it back? borgibo Linux - Newbie 1 05-19-2008 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:25 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