View previous topic :: View next topic |
Author |
Message |
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Tue Oct 24, 2017 5:06 am Post subject: Oops. Killed my Gentoo..., gparted failure = dead. |
|
|
Ahhh... Horrors.
I guess the wise saying of "There are only two kinds of people: Those who backup and those who never had a hard drive fail." didn't quite apply here... even people who never had hard drive fails (SOFTWARE FAIL!) could have benefited from a backup :(
I had a really old Gentoo laptop (though its Gentoo install was up to date) - a Pentium-M 1.6GHz with 1GB RAM that I sparingly use as it's sooo freaking slow nowadays (however, I use it because it's a laptop that still has a built in DB9 16550 serial port!). It was running a bit low on space on the Gentoo partition so I decided to use gparted to cut a bit more out of the Windows XP partition and donate to Gentoo. I've used gparted many times and it was surprisingly good, I never thought it would fail... "FAMOUS LAST WORDS"! :(
First try: Oddly enough the system rescue CD does NOT work properly on this ancient laptop as it does not indicate PAE support, and it didn't seem clear which kernels if any on the 5.0.2 sysrescuecd supported machines without PAE. Anyway, sysrescuecd was a no-go as it kept on crashing if I overrode PAE.
So on to a real gparted CD. So I tried using the gparted CD. It booted along just fine, and got into gparted fine. So I told it to shrink my XP partition, move the Gentoo partition to fill the slack, and extend it to the end of the new gap. It went ahead and moved the Windows partition just fine, but ended up hanging in Diskwait after it moved the beginning of the ext3fs partition and moved part of the data! Oh No! The disk still seems fine, just no activity to the disk anymore by gparted; other operations like dd to the disk and smartctl work just fine.
The beginning of the partition, which is now points inside the former slack space of XP, contains garbage now.
Unfortunately I should have recorded the beginning of the partition and see what happens if I moved the beginning back, but I don't have it, perhaps it's searchable. But I wonder what's the chances of recovering now. Sigh. Should have even backed up a not-used-so-much computer...
Currently running testdisk to see if I can locate the ext3 partition within the blobbed partition. Except the gparted cd kernel is constantly complaining about a hung task now, perhaps there is some non-disk failure going on here as smartctl is still clean... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
nokilli Apprentice
Joined: 25 Feb 2004 Posts: 196
|
Posted: Tue Oct 24, 2017 6:34 am Post subject: |
|
|
I wonder if recreating your original intent and using the best number that fits wouldn't be a good idea here. When you originally created the XP partition, there must have been some kind of logic to the number, yes? All of my partitions are on solid GB or MB boundaries that given disk size and partition role can almost be guessed correctly. And the math doesn't change. _________________ Today is the first day of the rest of your Gentoo installation. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Tue Oct 24, 2017 6:50 am Post subject: |
|
|
There may have been method to the madness back then, though the train of thought over 10 years ago probably differs than today. == Absolutely no clue how I decided back then.
This probably was my second Gentoo box ever after losing count...
Well, I am getting some hints from testdisk now at least, which sort of reminds me of the madness back then. The 1024 cylinder limit was something I had to deal with, alas that was not sufficient to figure out a beginning-end. Plus now testdisk is hinting that I may have used LBA blocks instead of CHS, so that adds a bit more to the confusion.
Alas some memories are coming back. This machine initially started with a 30GB that was pretty much instantly replaced with a 40GB, and later was copied to a 120GB disk which it now has... Now I have to remember what that 40GB disk to understand the 120GB disk.
I'll let testdisk run till the completion and stare at the data, hopefully it will tell me a good idea where the old start was. It may be best to image the disk to another disk and see if I can get anything that way first however. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Tue Oct 24, 2017 10:41 am Post subject: Re: Oops. Killed my Gentoo..., gparted failure = dead. |
|
|
eccerr0r wrote: | I guess the wise saying of "There are only two kinds of people: Those who backup and those who never had a hard drive fail." |
sorry for the lost, but i think i know that wise guy
eccerr0r wrote: | First try: Oddly enough the system rescue CD does NOT work properly on this ancient laptop as it does not indicate PAE support |
I'm totally lost there, why would anyone wish PAE to install a gentoo, why would anyone cares about PAE for a 1GB RAM computer?
What does PAE mean for you? (for me, allowing 32bits to use more than 4GB ram). |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Tue Oct 24, 2017 1:27 pm Post subject: |
|
|
krinn,
PAE provides other goodies on 32 bit systems too. Like the NX bit ...sometimes.
eccerr0r,
It all depends how far the copy got, what you can get back. As you were moving the partition start, it will be an overlapping copy.
Provided it didn't get as far as the overlap. your original data should still be in place and testdisk should find it.
Don't let testdisk write a new partition table. False positives for logical partitions will destroy your data,
Make a note af partition starts, convert to byte and use
Code: | mount -o ro,offset=<bytes> /dev/sda /mnt/someplace. |
offset=<bytes> is the partition start from the start of the drive, so there is no partition number in the mount command.
As its an ext3 partition you may be able to use alternate superblocks in that command too to mount a broken filesystem.
Add in a sb=<block>. <block> is the count of disk blocks from the start of the partition of the superblock you would like to use.
You will know (or learn) superblock numbers in terms of filesystem blocks, so need to multiply by 2, 4 or 8 to account for 1k, 2k or 4k filesystem block sizes.
You were expecting me to pop up here :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Tue Oct 24, 2017 2:01 pm Post subject: |
|
|
NeddySeagoon wrote: | You were expecting me to pop up here |
it's logic:
if you have a problem, if no one else can help, and if you can find them, maybe you can hire... the A-Team
if your problem is a ghost, call ghostbusters
if your problem is with computers, call NeddySeagoon
ps: Yes Neddy, if you fail he might then call the A-team to kick your ass. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Tue Oct 24, 2017 2:24 pm Post subject: |
|
|
:)
Yeah, one would think that PAE doesn't matter, but the default images on the systemrescuecd requires a PAE computer. I could have sworn all i686 machines had PAE including the Pentium-M, but I suppose not. Probably an oversight on my part trying to find a non PAE kernel on the sysrescuecd, I don't know, but the machine would not run correctly when forcing it to neglect the lack of PAE support.
I think the gparted cd's old 2.6 kernel probably has a bug that got caught up on this hardware though I'm pretty sure I ran 2.4 kernels (possibly 2.2 kernels too!) before. I guess I'm destroying this gparted CD and need to find another image to burn. Incidentally the testdisk on the gparted cd also hung along with my initial attempt at network imaging the disk.
My 32 bit non-PAE kernel on my "Gentoo on a stick" booted the machine just fine, and I was able to (easily) image the HDD to another disk over the network, all 120GB, with regular dd - and no bad sectors. I didn't have testdisk installed, so I emerged that, and testdisk found just possible start location for the damaged partition.
Thanks Neddy, yes, I should try the offset to see if I can recover that way before trying to move the partition back. That will tell me how much I can recover, and probably best to make a second, filesystem backup right away before going further. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Tue Oct 24, 2017 2:46 pm Post subject: |
|
|
well, i really don't get it about your PAE issue, however last time i use systemrescuecd it was using grub, which will allow you to boot with your own kernel (that you can copy on the usb stick) on the fly. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Tue Oct 24, 2017 2:52 pm Post subject: |
|
|
Hmm. Interesting. Alas I was using a burned cd, so no hot edits there (syslinux) though there were some strange options that might have worked but it would entail me having a static, non modular kernel ready.
But I was indeed surprised that the PAE kernel simply would not boot properly on the machine despite having less than 4GB RAM. Also I don't know why I didn't just use my "Gentoo on a stick" to run gparted as I had that installed on it too... it could have saved me this hassle of kernel bugs. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Tue Oct 24, 2017 2:56 pm Post subject: |
|
|
eccerr0r wrote: | Hmm. Interesting. Alas I was using a burned cd, so no hot edits there (syslinux) |
hell!!! i didn't think you were using it from a cd, i'm looking at the window to see if M. T is coming to get me. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22658
|
Posted: Wed Oct 25, 2017 2:18 am Post subject: |
|
|
Although the Kconfig help text is not explicit as to the reason, my understanding is that PAE support is so invasive that the kernel does not have the ability to enable/disable PAE at boot time, only at build time. So if it is enabled, it will be used when you boot, regardless of whether you have enough memory that you benefit from it. If it is used, it requires CPU support. Hence, a pre-PAE CPU will not be able to run a PAE-enabled kernel, even if you never mount enough memory that PAE would be desirable. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Wed Oct 25, 2017 3:06 am Post subject: |
|
|
Exactly.
I think most CPUs available today are PAE enabled (the original Pentium Pro had it!) but apparently something happened in the Pentium-M (which is a derivative of the P3, P2, and thus PPro as well) - which escapes me why it lost PAE support. Only the P5s and older clearly do not have PAE support.
Of course there's no reason to enable PAE on a machine with less than ~ 3GB RAM but most machines do have that much nowadays and people complain when their 4GB machine loses 768MB RAM... PAE also slows down computers slightly if it has to keep paging the other banks, the bank swaps are slow. I don't know how the kernel deals with PAE with less than 3GB RAM, as it would never have to page and thus will not suffer the bank swap speed. (BTW, I've seen some programs with around a 10% performance hit with a PAE kernel, which is still better than swapping...)
According to https://help.ubuntu.com/community/PAE my machine should support PAE (It's a Dothan Pentium-M) alas when the sysrescuecd boots it dies with no PAE support, and unstable when PAE is forced on. I just would have hoped there was a non PAE kernel on the sysrescuecd by default or at least make it easier to find... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Wed Oct 25, 2017 6:42 am Post subject: |
|
|
Whew! I think...
Testdisk found the CHS of the lost partition to be 2491/97/39. That translated to byte offset 512*(2491*255*63+97*63+38) = 20492320768 and the mount occurred properly on my image dump!
Now I got to see what happens if I just set the partition boundary back there, as so far the partition can be read from the image dump just fine (tar-gz'ing as we speak.)
Actually I suspect I could do the experiment on my image dump... but I'm feeling lucky now (another "famous last words..."?) and deleted/recreated the partition on the laptop, ran
# e2fsck -n -f /dev/sda3
...
and it came back clean! Disaster averted?
Now I'm going to gparted from Gentoo-on-a-stick... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Wed Oct 25, 2017 8:56 am Post subject: |
|
|
Hu wrote: | my understanding is that PAE support is so invasive that the kernel does not have the ability to enable/disable PAE at boot time, only at build time. So if it is enabled, it will be used when you boot, regardless of whether you have enough memory that you benefit from it. |
Ah funny, i like this kind of mystery too, digging myself to documentation, i find something:
kernel-parameters.txt wrote: | forcepae [X86-32]
Forcefully enable Physical Address Extension (PAE).
Many Pentium M systems disable PAE but may have a
functionally usable PAE implementation.
Warning: use of this parameter will taint the kernel
and may cause unknown problems.
|
It's really odd because it looks like it says a kernel PAE would enable PAE on cpus that declare their support for it.
It also point that Pentium M are bizarre with handling it (from this i read it as: pentium-M may have it disable and no PAE support, some pentium-M may have it disable while implementation is in fact present, enabling it on such cpu may cause problems).
Base on this, i think it is possible a 3rd case exists: pentium-M with buggy PAE implementation while they do have it enable.
It left us with these two cases:
- kernel PAE enable cannot work with non PAE cpu and eccerr0r have a pentium-M with PAE disable, it might be possible to boot such kernel for him with forcepae parameter, results are random (unknown problem)
- kernel PAE enable could work with non PAE cpu but eccerr0r have a pentium-M with PAE enable AND a buggy implementation. (nothing to do, except that you should just never share a lottery ticket with eccerr0r).
To endup the logic: if we consider kernel have the ability to enable PAE on cpus that do have PAE, it would still be really stupid to enable PAE for a CPU that is backup only by 1Gb memory.
The logic seems to says kernel with PAE have it always enable and could only run with a PAE cpu, that's why you don't have a parameter to disable PAE, but one to force it enable (with the hope the cpu do have what it need behind). |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Wed Oct 25, 2017 10:00 am Post subject: |
|
|
eccerr0r,
You don't have to move the partition start.
Make an extra partition and attach it to the filesystem tree somewhere. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Wed Oct 25, 2017 2:08 pm Post subject: |
|
|
Due to all i686 supposed to be able to support PAE, seems most distributions don't bother with providing a non-PAE kernel. I guess my poor old Dell Inspiron has been forcefully obsoleted by everything (including sysrescuecd) but Gentoo that I build my own kernel as part of bootstrap.
The partition recreate was successful, the newer gparted/kernel was successful at the partition move/resize, and the computer's hard drive can boot once more. Now need to make sure this machine is on the backup list :) _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|