spectere.net

The Chatterbox => Computing => Topic started by: Bobbias on April 26, 2011, 12:34:39 PM

Title: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Bobbias on April 26, 2011, 12:34:39 PM
So, I won't go into details, but I smacked my laptop a bit, and now my hard drive is fucked. And by fucked I mean I caused a head crash, and damaged a portion of the drive platter :/ I'm currently running gentoo off of a flash drive because windows won't boot. I'm thinking of trying to partition off my drive to avoid the broken sectors but to do that I need to be able to reliably find which sectors are bad... Any idea how I can do that from here?

I've already tried transplanting my old hard drive in, but it won't fit, and the drive in here doesn't use the usual power connector (it just has the other connector, with none of the power pins at all).

Anyway, I don't know what tools I should be looking for to try to deal with this, I'm gonna do some googling, but I'm pretty lost here.
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 27, 2011, 02:47:31 PM
The actual damage caused by a head crash is going to depend on the encoding of the hard drive.  There really isn't a good way to find out for sure outside of running an intense test like DFT (Drive Fitness Test), and even then there's no guarantee that the affected sections of the drive will actually appear as being sequential to the system itself.

One thing that you could try doing is grabbing a tool like ddrescue and trying to build an image file with that.  Make sure to specify a larger block size by default, otherwise it's going to go quite slowly.

There is also a very helpful article on data recovery on the Ubuntu wiki that I've found to be invaluable: https://help.ubuntu.com/community/DataRecovery (https://help.ubuntu.com/community/DataRecovery).  That should at least allow you to recover some of your data.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 27, 2011, 03:50:52 PM
Well the thing is, I have run DFT, and I have run SpinRite. It took over 3 days to go through the drive, there's a huge section that SpinRite has said it can't even find the sectors in.

I don't care as much about recovering data, what I'm trying to do is make it o that I can at least run windows (or even gentoo) on the drive in the undamaged sections until we can order a replacement.

The other thing is that I want to find a replacement drive. I tried transplanting my old drive from my old laptop, but it didn't fit because of the case screws being located on the sides of the case. The drive in this laptop has little metal flanges that lock it in place. It also doesn't use the power connectors for some reason (though a drive with the connectors will likely fit).

I'd like to order a new drive to throw in here but I have no idea how to find one that will actually fit.
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 27, 2011, 07:21:49 PM
All SATA and PATA notebook hard drives within at least the last decade are standardized.  Some manufacturers include slot connectors and other such things to adapt it to a non-standard connector (this is most common on PATA drives, since the pins can be easily bent if you push it in the wrong way), but all drives will work.

Drives also have screws on the bottom and sides, and some drive containers use both.  All three of the Dells here use a tray with screws on the side, for instance.  To replace the hard drive, you'd unscrew the drive, remove it, remove the PATA adapter (the two SATA laptops don't use an adapter), mount the new drive to the tray, and slide it in.

If you can get decent pictures of the hard drive and bracket for both drives I can probably give you a better idea of what you'll have to do.  I've replaced lots of laptop hard drives and have seen just about every kind of mounting system from within the last decade.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 27, 2011, 09:48:31 PM
Well I managed to get my old hard drive to fit after removing the 2 screws on the side (and realizing that it didn't use the pin connectors either). It fits now, but the case on the hard drive that is supposed to be in this laptop has a tab with a hole in it to lock it in place with a screw, while the one I have in here right now doesn't. The biggest issue is that the hard drive from my old laptop (the one in here now) is running a windows vista install, and isn't activated for this laptop, and has no drivers, so it can't even connect to my network. I could likely get some drivers and make them work if I really wanted to, I guess.

I've got my brother downloading an ISO of Win7 ultimate because I can install home premium from that anyway. Of course he doesn't seem to realize that downloading that ISO takes presidence over him playing his games. So for now I'm using my stripped down gentoo-on-a-flash-drive for internet access with links.... The internet sucks in text though :S

So, If I just buy any random drive, I should be able to make it fit in here? If that's the case, then I'll get one ordered ASAP.

EDIT: I noticed that there were holes in the top of the old drive, and removed the mounting bracket from the new one and sure enough, it fits.

Of course, this is really just a hold off until I can order a new drive, because this one is kinda small, and I can get a 640GB drive for like, $70 + shipping.
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 28, 2011, 01:31:38 AM
Yep, you can buy any random drive.  If the laptop is older (read: PATA) you might be bumping against 120GB limitations, since those were very real for mobile chipsets in systems from 2004-2005, but if you're using SATA you should be able to throw any hard drive in there without a problem.

Also, you might have to do a little bit of tweaking with that Windows 7 ISO.  There's a file called ei.cfg (I think it's in I386) that stores the edition of the disc.  If you delete that (or use a tool that plucks it from the ISO for you) you'll be able to choose any edition during the installation process.  I think they might have done that for branding purposes, but it is a barrier that you have to keep in mind.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 28, 2011, 12:53:36 PM
Really? I'm surprised, since I used a Vista Ultimate CD (official) to install vista tp upgrade it to Win7 at a friend's place (since he didnt have an actual Win7 full install disk) and It let me select which edition I wanted to install. I figured itd be the same with Win7.

And this is a fairly new laptop, it's the one I mentioned getting when my old one's fan died a couple months ago, so it's SATA. It came with a 320 GB drive. I'm gonna try and convince my parents to buy a 640 GB drive, because they're actually not that expensive.
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 28, 2011, 02:34:23 PM
I think it might have something to do with the type of disc that it is.  OEM discs are edition "locked" for obvious reasons (though, again, it's easy to rectify that).  I have a feeling that retail discs are pretty open, though TechNet discs (which are classified as retail copies) don't allow cross-edition installation.

It's kind of weird.  I haven't really figured out the pattern just yet.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 28, 2011, 05:03:50 PM
Been trying to install gentoo in the mean time. Reminds me of why I hated myself during the entire tie I was working on that last time.

I've got grub installed, and I managed to boot it up once and got into the login screen (and got stuck because I didnt know the root password). I went back into the flash drive, chrooted in, and used passwd, rebooted, and now it scrolls a bunch of text for a short period, and then the screen goes black and nothing happens :/
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 28, 2011, 06:12:30 PM
The hard drive could just be getting worse.  I'm pretty sure that head crashes can lead to the platters becoming demagnitized.  Additionally, some hard drive controllers freeze when there is physical damage on the drive, so the drive could be effectively shutting itself off.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 28, 2011, 06:16:57 PM
This is on the small hard drive from my old laptop, which is in perfect condition as far as I can tell.

EDIT: well after a kernel rebuild it seems to work... Odd.
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 28, 2011, 10:49:06 PM
Ah, gotcha.

If that's the case, it sounds like it might have been trying to call an invalid framebuffer device or something.  Doing the kernel rebuild probably killed the bad module that it was loading.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 28, 2011, 11:12:59 PM
Ok, so how the fuck do I set up wireless? I'm pretty much completely lost on what to do to set up my wireless stuff. Ive emerged wireless-tools and I'v built the module I need for my card into the kernel. I noticed a weird interface called sit0 show up when I did a iwconfig, but none of the interfaces were listed as having wireless extensions...

For reference, I have a broadcom BCM43225 card for wireless....
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 29, 2011, 01:29:17 AM
Wireless in Linux is, and will probably always be, bullshit.

If you're using anything better than WEP, you'll need to emerge wpa-supplicant and fudge around with the wpa-supplicant.conf (http://linux.die.net/man/5/wpa_supplicant.conf) file for it.  Thankfully, after that Gentoo takes care of most of the grunt work for you after you get that far.  I think all you have to do is throw a line in your /etc/conf.d/net file to enable wpa-supplicant.  You should be able to find more info about that in the wireless guide.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 29, 2011, 09:09:57 AM
I'm gonna be connecting to an unsecured connection, because honestly, someone who wants to break in to a wireless connection can, and I doubt my wireless travels THAT far outside the house.... The router is in the basement.

Anyway, I have wireless-tools emerged, and I added a line to the /etc/conf.d/net file. I'd like to learn more about how all these things work together to actually become useful though, If I understood the underlieing linux structure here I'd probably have no trouble making things work :/
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 29, 2011, 09:03:51 PM
Considering that you could potentially be liable for someone else abusing your Internet connection with unprotected wi-fi (liability is still a very shaky thing when it comes to that), I would put as much between them and your network as possible.

WPA2 still has yet to be fully cracked yet (hole 196 did *not* completely shatter WPA2), and even WPA-AES offers reasonable protection, so there's no reason not to be using one of those.

As for configuring wireless, it's not so much understanding the underlying structure as it is understanding how the distribution works and the configuration options for whatever is installed.  As per *nix tradition, there's almost nothing standard about it.
Title: Re: So my harddrive is fucked...
Post by: MortifiedocAlot on April 30, 2011, 03:18:46 AM
WPA2 still has yet to be fully cracked yet (hole 196 did *not* completely shatter WPA2), and even WPA-AES offers reasonable protection, so there's no reason not to be using one of those.

So you wouldn't recommend having JUST a pass-worded modem? I live with basically one neighbor who MIGHT be able to get access (the router is to a wall, but I live on acre plots of land).
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 30, 2011, 04:34:34 AM
I'm not sure I follow.

If by passworded you mean the setup interface, then that's not going to prevent anyone from getting on your wi-fi.  All that's going to do is prevent them from making changes to the configuration.

If you mean that you need a password to connect to your wireless at all then you're most likely using some sort of wireless encryption.  Some modems do have built-in wireless access points, so if you don't have a router, per se, you might still have secured wireless.
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 30, 2011, 06:56:05 PM
Well I'm a step closer to where I want to be right now. Apparently dmesg says that brcm80211 is looking for firmware that I dont have.

I have the b34-fwcutter to grab the firmware out of a driver, but I can't seem to figure out what driver to cut it from, and when I try, it just says that the MD5 is wrong.

All I need is bcm43xx-0.fw..

PSEUDO-EDIT: Found it from a link to a debian git repository, downloaded, placed in right spot, and it works. and I figured out how to configure everything else I needed reading the gentoo handbook.
Title: Re: So my harddrive is fucked...
Post by: Spectere on April 30, 2011, 07:22:37 PM
Ah yeah, I didn't even think of that.  Wireless firmware is annoying.

My favorite Linux wireless experience was when I needed to get my laptop's wireless working and the site that hosted the firmware for the Intel 2100BG driver was down. D:
Title: Re: So my harddrive is fucked...
Post by: Bobbias on April 30, 2011, 08:06:40 PM
Ouch. Well, I'm now posting from konqueror in my shiny new KDE desktop, emerging mplayer, and trying to figure out how to get flash working...

I've got the adobe-flash package emerged, and pointed konqueror to the right location, and hit scan for plugins, but got nothing.

So I decided to emerge chromium and see how that works, since I love chrome anyway.

I've noticed something about the wireless though, which is really annoying. It seems to drop out all the time, and not automatically connect. It's not a huge deal because all I need to do is type "iw wlan0 connect bobbias" but its kinda annoying, is there some way I can configure things to automatically reconnect?

EDIT: I found a tool called wicd, hopefully that will help things, though from the sounds of it its designed to restart the interface when it stops, rather than reconnecting to the correct SSID when the connection drops (which in itself is a bit unusual because the connection quality is pretty good.

EDIT2: And I'm still compiling Chromium :/ good god this takes a long time.

EDIT3: Great, I begin to get things working, and end up taking a few steps back. For some reason my wireless is becoming somewhat unstable. I couldn't get a DHCP lease, and I've been stuck manually running dhclient to get it (not that bad, considering I actually know how to use iwconfig and iw now).

The real step back though is that I decided I wanted to grab PulseAudio and get it working, because flash in chromium doesn't have sound, and now my system tells me that my main device isn't working. The fuck. I've done emerge --newuse -p world to check if anything needed to be rebuilt after selecting pulseaudio as a use, and I rebuilt mplayer, but none of the kde stuff came up.

EDIT: Well it seems that now pulseaudio might be working, but KDE doesn't like it. It tells me that a device isnt working, and I can't get kmplayer to play music, but flash finally has sound.

EDIT: and it mysteriously works.... Though I still cant get sound out of mplayer :/ (and all the levels are up, nothing is muted)
Title: Re: So my harddrive is fucked...
Post by: Bobbias on May 02, 2011, 04:33:19 AM
doublepost for weird shit..

I got pulseaudio to at least load (it was failing to load some modules, I commented out the lines, and it works, apparently).

Too bad VLC seems to blow up when launching media. It slows the system right down to a crawl, seems to be reading the hard drive a LOT (even on streamed media), eventually necessitating a hard reboot.

Mplayer either complains that the buffer isn't filling (di.fm techno MP3 stream) or tells me my system is too slow, plays the video in fast forward, and then spams the console with:
Code: [Select]
Too many video packets in the buffer: (4096 in 8350153 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
A: 216.5 V:  79.9 A-V:136.525 ct:  0.003   0/  0  7%  0%  1.2% 2383 0

WTF. Currently recompiling both to see if that fixes it.

EDIT: VLC still blows up and kill the system, but mplayer works with pulseaudio finally.

BIG problem though. brcm80211 causes completely random kernel panics :S HALP
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Spectere on May 07, 2011, 05:56:21 PM
Are you using genkernel or a fully customized one?
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Bobbias on May 08, 2011, 10:23:34 AM
Customized one. Luckily, I haven't had to deal with it for a while because I've got my new hard drive, but I still want to get a fixed, fully functional gentoo system running on my old hard drive sometime.

I'm using the bcm80211 driver, because I have a braodcom 43225 wireless card in here. I have the bcm80211-0.fw and whatever the other firmware file that I needed was. I got those from the debian git tree, but they should be the same as any other one I grab. I just couldn't seem to figure out which version of the openwrt drivers I was supposed to use the firmware cutter on, so when I found the debian download, I grabbed that, and it worked fine for a while before giving me those kernel panics.

The error that was showing up at the top of the screen when the panics were happening had something to do with synchronization, and the stack trace had some functions from bcm80211 and mac80211 in the list, so that's why I think its the wireless.

Also, I somehow completely destroyed all audio on there. I was trying to get pulseaudio to work, and nothing would connect to it, so I eventually unmerged it, set the user flag -pulseaudio and rebuilt stuff, and now even alsa doesn't work right :/
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Spectere on May 08, 2011, 03:51:56 PM
Make sure that you're using the correct firmware version for the drivers that you have installed.  I know that the Intel 2200BG driver needed specific firmware versions for specific driver versions (though that driver didn't smash the system if it didn't get what it wanted).

Another option is to just give ndiswrapper a shot and just use your Windows drivers.  From what I saw at a quick glance, it seems like some people just can't get the bcm80211 driver working no matter what they try.  There is also an official Broadcom driver available (broadcom-sta) that you can unmask and emerge if you like.
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Bobbias on May 08, 2011, 04:44:48 PM
I've been a bit wary of trying another driver, because with my luck things tend to break pretty terribly when I do stuff like that, lol. I haven't directly heard anything about firmware versions, other than that when you use the firmware cutter you need to chose to use it on different versions of the openwrt drivers depending on your hardware but when I tried using the firmware cutter it just complained that the MD5 was unknown for every version of the driver I tried. But as far as I know, the driver (bcm80211) requires bcm43xx-0.fw and a second file that I can't remember the filename for.

I've also got a rather bad audio problem. I tried getting pulseaudio to work. Nothing would connect to it, and the only program I actually had sound from was Chromiums flash. After unmerging pulseaudio and rebuilding all my software with -pulseaudio in the use flags to make sure nothing was gonna try to use pulseaudio after, now I have no sound at all. I get an error basically amounting to "shit was busy, couldn't use alsa".

I'm already in the audio user group, and all the devices have the proper permissions, I only have 2 users, root and bobbias, and root shouldn't be using any of the audio hardware, because basically everything audio doesn't want you using it as root anyway... I've tried various configurations in the asoundrc file, and even tried pointing mplayer to the device directly (-ao alsa:device=hw=0.x). I know 0.0 is the Analog out for my sound chip (the desired output for speakers/headphones), 0.1 is the digital out, and 1.0 is the HDMI out. I tried everything with no luck there. So it seems that there is something very wrong.
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Spectere on May 09, 2011, 12:33:43 AM
Well, it's already kind of broken now, so trying a different driver couldn't make matters any worse. :p

I've never set up PulseAudio from scratch, so I dunno.  I've always just used ALSA directly (though I plan to use that on the Gentoo install that I'm currently working on).

You're doing this on a laptop, right?  Try plugging in headphones just for shits and giggles.

Also, off-topic bragging: It only took 8 minutes, 27 seconds to compile an x86-64 build of glibc on my i7-930. :o
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Bobbias on May 10, 2011, 12:04:57 AM
Nice. And yeah, I've tried with headphones, nothing there either :/
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Spectere on May 11, 2011, 01:54:40 AM
How did you set up PulseAudio, exactly?  I just set it up on mine (couldn't really give it a good shot, since it seems to be very dependent on being managed by an X environment's sound system, which I don't have installed just yet) and it seems like there are two ways to do it:

1) Set up the service to run on startup and throw your user into the pulse group.

2) Do not set up the service to run on startup with rc-update and, preferably, pull your user out of the audio group.  Add the service to plugdev and let hal and dbus take care of starting it.

I went with option 2, though I kept my user in audio (I don't think I've quite broken my reliance on /dev/sound, and I like to be able to use ALSA directly from the shell if need-be).

I'd give ALSA a good test to make sure that the basics are configured right.  Kill X and emerge mpg123 like so:

Code: [Select]
USE="+alsa" emerge mpg123
Now, switch to a directory with MP3s in it and invoke it as follows:

Code: [Select]
mpg123 -o alsa [i]filename.mp3[/i]
Try it with root first to make sure that your sound card is being picked up and initialized okay, then try it with your user to make sure that you can get sound as an unprivileged user (note: you will need to be in the audio group to use that as an unprivileged user.  If you aren't in that group, do "usermod -a -G audio bobbias" as root).

My sound card (an X-Fi) seemed to initialize at full volume, strangely enough.  This might not be the case for yours, so you might have to emerge alsa-utils and check your levels with alsamixer before you'll be able to hear anything.

Let me know how that works out for you.
Title: Re: borked HD? try gentoo: HALP KERNEL PANIC D:
Post by: Bobbias on May 11, 2011, 05:47:31 AM
I'll have to get back to you next time I go back to trying to get gentoo working... My card is being picked up, because when I run alsaconfig it picks the name, etc. up fine, and seems to set everything right...

Anyway, I'll revive this topic whenever I get back to trying to fix that.