Data Loss over nicked partition table due to faulty Linux installation
Linux - SoftwareThis 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
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.
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.
Data Loss over nicked partition table due to faulty Linux installation
Hello all,
I have run into trouble with my little netbook when trying to install Manjaro Linux. I initially had a Lubuntu 14.04.4 installation, and replaced it with a distribution called Voyager. I did not like voyager as it did not include the features in the installation that were originally there in the live environment. As a result, I went to replace it with Manjaro 16.06. Soon after finding the variant I wanted, I attempted installations with Manjaro (with all three separate installers) several times and failed. My intentions were to leave my home directory intact while obliterating everything else of the previous installation to pave the way for the new one. Upon a successful installation of Manjaro, it has rendered my laptop unbootable, with my previously known Lubuntu/Voyager partition, was nicked and gone. I managed to recover the partition by running testdisk and writing it to the partition table. Once that was done, I attempted to repair the filesystem by fsck.ext4, (which took several hours), and finishing with me only being able to see a "lost+found" folder in which I could not view the files due to the terminal hanging on the ls command when I tried to see if my files were there. File Managers were no different as they hung as well, with the files not showing. The end result was running an fsck operation which took many hours, with the files within the directory (practically) unviewable.
I could use some help in this process of attempting to recover my data and my Partition. I guess I will settle with Debian in the end.
All help will be greatly appreciated.
Computer: Dell Inspiron Mini
CPU: Intel Atom 1.66 GHz or so
Misc: w/ Other Intel related Hardware
MultiBoot platform/installation.
I'll leave it to someone with more knowledge than me to help you recover your data, if possible.
However, what I would *strongly* recommend is that before carrying out any procedure such as an install or upgrade, in future you back up your partitions to an external device using software such as CloneZilla booted off a USB stick. That way, if the procedure goes awry, you can easily revert to the previously good configuration by recovering those partitions to your disk.
CloneZilla isn't the only option - there are other partition imaging applications and Linux commands out there. Personally I use another tool, Macrium Reflect, for historical reasons (I've used it for a long while, even in my Windows days) but this needs built in a Windows environment, for which I use a Windows VM, so would not be a good choice for you.
Using Clonezilla, Macrium Reflect, or any other tool that is aware of disk structure is foolhardy when the structure on that drive is known (or even suspected) to be corrupt. The only way to make a meaningful backup of such a drive is with a raw bit-for-bit copy as is done by the dd utility. If you are lucky, the structure-aware tool will figuratively throw up its hands and resort to a bit-for-bit copy, but you shouldn't rely on that. In any event, you will need another drive at least as large as the one you are copying or else a filesystem with at least that much free space.
I'll leave it to someone with more knowledge than me to help you recover your data, if possible.
However, what I would *strongly* recommend is that before carrying out any procedure such as an install or upgrade, in future you back up your partitions to an external device using software such as CloneZilla booted off a USB stick. That way, if the procedure goes awry, you can easily revert to the previously good configuration by recovering those partitions to your disk.
According to what donald3.heckel says, he wanted to "leave his home directory intact". This could be achieved by a simple manual backup to a pen-drive ...
Using Clonezilla, Macrium Reflect, or any other tool that is aware of disk structure is foolhardy when the structure on that drive is known (or even suspected) to be corrupt. The only way to make a meaningful backup of such a drive is with a raw bit-for-bit copy as is done by the dd utility. If you are lucky, the structure-aware tool will figuratively throw up its hands and resort to a bit-for-bit copy, but you shouldn't rely on that. In any event, you will need another drive at least as large as the one you are copying or else a filesystem with at least that much free space.
Indeed. I'd just like to point out that partition imaging was mentioned not as a solution to the OP's problem but as a measure to be taken in the future *before* carrying out any significant operations that would have the potential of banjaxing the filesystem.
For a case of known or suspected corruption, Macrium Reflect can be used to carry out a "forensic" sector copy (i.e. all sectors are copied, no matter the contents of any filesystem in the partition). I would have hoped that CloneZilla had similar functionality, but that wasn't what was being suggested, it was the idea that you should always back up your system before carrying out a procedure such as an install or upgrade (see my first post).
According to what donald3.heckel says, he wanted to "leave his home directory intact". This could be achieved by a simple manual backup to a pen-drive ...
.
But I *enjoy* using my sledgehammer to crack nuts. Yes, in this case you're spot on.
Every user has a user number. These numbers are used to assign file ownership. What number a distribution assigns to a user varies widely from distribution to distribution. If your new distribution assigns different numbers to your users than the user numbers used in the files in your original home directory then your user names become useless.
Therefore I suggest that you back up all of your user data files, install your new system on a new partition, restore your user files to within your new home directory, and then, as root, use the chown command to change the ownership of your user data files to the correct user name.
That advice is very helpful. As for the file recovery, I could look into testdisk a bit further. I am currently using LParted to attempt a full restoration. Could there perhaps be a GNU/OSource forensic solution that could be suggested?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.