I am a stupid Linux user who messed up my netbook.
October 21, 2010 3:54 AM   Subscribe

I am a stupid Linux user: I was cleaning up my netbook's hard drive and somehow trashed keyboard & mouse support.

Ok, we've got these sweet Aspire One netbooks, both with SSDs. My internal SSD became full, and I was trying to clean up by trashing files in /var/spool (maybe other directors as well). I thought that was the only place I hit, but upon rebooting found my keyboard & mouse inoperative.

On both machines we keep everything out on a 16GB SD card, but our /home directories are on the internal SSD. So it would appear that some personal data that I'd rather not lose if possible resides internally. I'd rather not reinstall if possible, as the Aspire One has a non standard wireless card, and I recall it was a little rough getting a distro to work.

I know its something with the CrunchBang installation, as I can boot off a live USB and things are fine. I can't, for the life of me, remember root password that I created when I originally installed, so while booting into recovery mode works, it is useless (prompts for root password which I don't know and isn't' my current root).

Now I do have Mrs Mutant's netbook which is an exact twin (Aspire One w/SSD and CrunchBang Linux installed); would this be of any help?

I was thinking of simply copying her /var to my machine (please be gentle I'm a banker not a linux person!), or is this a bad idea? If a good idea, could you please be so kind as to post step by step, mounting, etc, as I don't have a clue.

Thanks for any help!
posted by Mutant to Computers & Internet (7 answers total) 3 users marked this as a favorite
 
Best answer: You can get around the root password by booting into single user mode, usually by appending the word "single" to the boot command line in grub.

Otherwise, since according to your description, you can also use the other laptop to get at your /etc (which is on the card, right?) you can simply reset the root entry in /etc/shadow to have an empty password or the same password as your user account.

Not much help on the other issue, but it seems weird that this would happen if you only ruined /var. You get the graphical login screen, but have no keyboard or mouse input? What if you switch to a text console (Ctrl+Alt+F1)?
posted by themel at 4:26 AM on October 21, 2010


Best answer: Here's how to reset your root password using a Knoppix Live CD. The procedure should actually be pretty similar no matter what live distro you are using.

Here's how to mount a USB drive (read the Manual Mounting bit). I would copy the files from /home to your USB drive before I did anything, just in case. Do this with your live CD before you even try to reset your root password.

If the keyboard and mouse work under a live distro, it does mean that it is not a hardware problem. It could be related to the configuration of X or your Window Manager. If you're feeling daring (and you've backed up your /home) why not try reconfiguring X (just do the bit under Configure X, after you have booted into single-user mode).

Good luck!
posted by humpy at 5:07 AM on October 21, 2010


Best answer: I was thinking of simply copying her /var to my machine

The stuff in /var is supposed to be variable things like caches, logs and generally non-essential stuff you could probably stand to lose (that's why it's called var!), as explained here. Some of the things in there you definitely do not need to copy (such as /var/run), and others you probably don't need to but won't hurt. It is possible that some essential things are in /var/lib, so try restoring these first.

It is also possible the trouble is caused not by missing data, but rather by missing directories: Some program might be trying to write temporary data to a directory that doesn't exist - the specific data do not matter, but the directory needs to be there. You could try listing all the directories in /var on the other netbook, and recreating them in the damaged one.

Keep in mind that /var is not supposed to be shared accross systems though, and you could theoretically mess things up further by attempting to copy stuff from the other netbook. You definitely need to boot using a live CD and copy your /home partition to safety before doing anything else.

My advice would be to forget about salvaging your system, and focus on saving your data. Even if you manage to bring the system back to working condition, you won't be sure you have everything in order and can run into other trouble down the road, leading to data loss or failure at a critical moment.

Is the internal SSD accessible, and would you consider springing for a new one? My (maximalistic) solution at this point would be to take it out, install a fresh one and start a new install. This way you keep all your data on the old SSD, and have whatever is left of your old configuration as a reference to help you set up the new system. After everything is back to normal, all your data is secure and the system is up and running, you can wipe the old disk and keep it around as a hardware spare.

A less costly (but more risky) approach would be to dump an image of your current SSD out to some other medium using a live cd, and then reinstall on your current SSD.
posted by Dr Dracator at 5:44 AM on October 21, 2010


Best answer: Mutant: "I know its something with the CrunchBang installation, as I can boot off a live USB and things are fine. I can't, for the life of me, remember root password that I created when I originally installed, so while booting into recovery mode works, it is useless (prompts for root password which I don't know and isn't' my current root). "

Well, for not a Linux person, you've chosen a funny Linux distro. Anyways, I hope this means you know what the grub boot loader and bash are. Because here's the standard way to hack a linux disk:

1. Edit the grub menu (hit 'e' at the menu) item for the linux partition you want, and add (or change if already present) init=/bin/bash.
2. Hit b to boot. It will go very fast because nothing will start up, not even init. Just a bash command line running as root.
3. Run passwd and remember the damn password this time =)

Technically, Ubuntu comes with a recovery console mode, but it sounds like it's not working so either you or Crunchbang broke it. The method hopefully works regardless.
posted by pwnguin at 9:21 AM on October 21, 2010


And I fail at previewing. Add init=/bin/bash to the kernel parameters.
posted by pwnguin at 9:22 AM on October 21, 2010


Response by poster: Ok good tips all around guys, looks like I must have hit something else other than /var so I ended up booting off the CrunchBang live USB, mounted then copied /home to the SD card and reinstalled. It seems during boot it was complaining about missing directories, but I didn't want to screw about too much.

I repartitioned the SSD (OS and /home) and migrated my swap partition to the SD card as I did with the original install since I didn't want to degrade the SSD by repeated writes (which I freely admit may be ignorant paranoia on my part ... ).

Seemed like the most expedient all around. Netbook is up and running again, with a system upgrade / reconfig (copying a bunch of files off my original home dir on the SD card / and reinstall (LiveStation TV which I use to track the markets and Nautilus file manager) necessary. Very clean to be honest, biggest PIA was waiting while this rather slow machine chewed on the upgrade (that step alone took almost one hour).

It was actually good to repartition and reinstall, as I'd messed up the partition when installing CrunchBang, and could only devote 3GB (out of 8GB) to that installation. To be honest I'd totally forgot about the "lost" drive space until partition manager (gparted?) launched when I installed (I originally built these machines well over a year ago and had just used them since, which is a testament to the distro, very clean, very nice, very trouble free).

So all things considered it was best I reinstalled but thanks to your tips I managed to recover my /home so nothing was lost.

Many thanks for your help - much appreciated !


Oh yeh, I remember why we chose CrunchBang - it was on the only distro that ran cleanly on the Aspire One hardware out of the box; apparently the wireless card messes up most distros and we simply couldn't find one that worked without mucking about with Windows drivers and NDIS). That being said, the distro does precisely what we want, is fast and easy on the eyes; a good job whomever is responsible.

posted by Mutant at 2:27 AM on October 22, 2010


And you said you weren't a Linux person!
posted by pwnguin at 9:56 AM on October 22, 2010


« Older These boots are somewhat made for walking.   |   Getting my Dad to Oz Newer »
This thread is closed to new comments.