Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
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.
|
 |
07-08-2007, 03:56 PM
|
#1
|
LQ Newbie
Registered: Jul 2007
Posts: 4
Rep:
|
Undeleting /home/$username on ext3
Hi,
I have the following problem: I wanted to create a kde-devel account on a different partition than the one my system (Ubuntu Feisty) is installed on. So I mounted the partition as /media/dev7, and then did a
Code:
sudo mount /media/dev7 /home --bind
Not knowing what I just did, I added a new user "kde-devel" and created the new home dir in /home/kde-devel, not noticing that my own one (/home/joh) was gone...
So, after some time, I did notice it, and looked for a tool to recover folders on ext3. Apparently, it's not possible since ext3 completely zeroes out the files and folders, instead of just marking them as free space on the hdd.
But in my case, I did not use "rm".
I could figure out the inodes of all the (now invisible) folders, including /home/joh, and all the subdirs using a little tool called "giis", even though it's only able to recover files deleted after the installation.
Is there a way to undelete/recover a folder if I know its inode?
Joh
|
|
|
07-08-2007, 05:02 PM
|
#2
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Restore from backup. If you don't take backups, now you know why you need to.
|
|
|
07-08-2007, 05:24 PM
|
#3
|
LQ Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019
Rep: 
|
I guess all you can do is get photorec. If it's your personal data you're after, you should find it quite reliable (although far from perfect with multimedia files as I found out). It doesn't recover folders, only individual files. The original names are lost so there will be quite a bit of sorting if you had many files; on the other hand, photorec allows specifying the exact sort of files you need to recover. And yes, ext3 is a bit problematic in such a case but it's usually not as bad as it sounds.
Last edited by jay73; 07-08-2007 at 05:25 PM.
|
|
|
07-08-2007, 06:21 PM
|
#4
|
Member
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 298
Rep:
|
Quote:
Originally Posted by Sangaho
Is there a way to undelete/recover a folder if I know its inode?
|
The way I understand you, your files have not been deleted at all. You just mounted another partition on top of them. If you unmount your current /home, the old files will be accessible again. Move them to a temporary directory (outside /home obviously), then remount /home.
|
|
|
07-08-2007, 06:52 PM
|
#5
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
Quote:
Originally Posted by rupertwh
The way I understand you, your files have not been deleted at all. You just mounted another partition on top of them. If you unmount your current /home, the old files will be accessible again. Move them to a temporary directory (outside /home obviously), then remount /home.
|
I think you're right. It sounds like the original /home directory contents are hiding under the mounted partition.
|
|
|
07-08-2007, 07:10 PM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Yes, rupertwh is correct. The kde-devel account doesn't need to have its home directory under /home. You could have a /home2 directory and use that. As long as the /etc/passwd entry has /home2/kde-devel as the homepage, it would be fine.
|
|
|
07-09-2007, 08:12 AM
|
#7
|
LQ Newbie
Registered: Jul 2007
Posts: 4
Original Poster
Rep:
|
You were all right. I just rebooted the computer and everything was fine again. Puhh.. 
Thanks for your help!
|
|
|
All times are GMT -5. The time now is 07:45 AM.
|
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
|
|