LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   After a powerbreak, Linux can't boot (https://www.linuxquestions.org/questions/linux-newbie-8/after-a-powerbreak-linux-cant-boot-392759/)

rabalder321 12-14-2005 10:08 AM

After a powerbreak, Linux can't boot
 
Hello

The power went down as I had my computer on, and now Linux (Slackware 10.1) won't boot.

I get to the part where the file systems are checked, and my computer tells me there's an error in the file system of /dev/hda1, my root partition.

I get the option to either reboot right away, or type the root password and run some system restore utility, but as soon as I type the password and press enter the system reboots.

If I ctrl-c during the reboot, I get to the usual login part, where I login as root. But when I've entered the password and pressed enter, my computer says:

Unable to change tty /dev/tty1: Read-only filesystem
-bash: id: command not found
-bash: fortune: command not found


I don't have a floppy-drive, thus no boot-disk is available, but maybe theres a way to run some kind of utility from the install-cds (like fsck)? Maybe fstab somehow changed the hda1 to read-only, but as I can't get to a prompt where I can write anything, I don't see any solution to altering the file.

Thanks for any help!

rabalder321 12-14-2005 11:25 AM

I got it to work!

I passed the following argument to the bootloader:

linux init=/bin/sh

From there I managed to run

fsck

and now it all works just fine!

But I have another question now. When i got logged in after passing the arguments, it seemed as though I was automatically logged in as root. I could access the root directory, and I was able to change to any user without having to give a password. Isn't it possible for anyone to pass linux init=/bin/sh at the bootloader and gain access to everything on my computer? Or to make it a more practical question, how do I fix this so that root privileges are gained only after a password check?

Thanks for any help!

michapma 12-14-2005 11:28 AM

The root system has apparently become corrupted (the inode table or something, I'm no expert on file systems). When you press ctl-c the system is probably loading the root system read-only, making your system inaccessable to its users.

If you have access to the Internet and a CD-burner, you can burn the full version of the Ultimate Boot CD:
http://www.ultimatebootcd.com/
The full version has INSERT, a live Linux version well suited to diagnostics. From there you can do some fs checking such as e2fsck or whatever is appropriate.

Otherwise, there are also distributions bootable from floppy, they're just less nice.

Good luck

michapma 12-14-2005 11:31 AM

Ah, just a couple minutes too late. You should burn that Ultimate Boot CD anyway just for future incidents. :)

Your other question is addressed here:
http://www.debian.org/doc/manuals/se...el-root-prompt

That's for Debian but it's a kernel thing and should also work in Slack I guess.

cheers

btmiller 12-14-2005 11:44 PM

Rbalder, anyone with physical access to your computer can break into it (or if all else fails just remove the hard drive). This is true of any operating system, and part of the reason why critical computer systems are locked in well-guarded rooms. There's a way to password protect single user mode, but it's easily bypassed with init=/bin/sh which will simply spawn a shell and not do any of the normal init process. The standard way to do it is:

(1) Password protect the bootloader so you can't change the kernel arguments without typing in the password (GRUB can do this, not sure about LILO).

(2) Set the BIOS to only boot off of the hard drive.

(3) password protect the BIOS so the boot order can't be changed (no booting off of LiveCDs).

michapma 12-15-2005 06:07 AM

Well as long as we're being absolute, that's not 100% secure either. From the same "Securing Debian" manual:

"Note: many BIOSes have well known default master passwords, and applications also exist to retrieve the passwords from the BIOS. Corollary: don't depend on this measure to secure console access to system."

Maybe keeping a Doberman in your apartment? :)

nx5000 12-15-2005 06:53 AM

A bit off topic but..
Quote:

Originally Posted by btmiller
(3) password protect the BIOS so the boot order can't be changed (no booting off of LiveCDs).

Open the computer, remove the CMOS battery, wait 10mn
=>
No more bios password

So in a lot of secure rooms you have:
(4) Lock your cpu with special screws so that it can't be opened easily or at least without noticing it has been opened.

There are still methods to remove the password without even touching the computer.


All times are GMT -5. The time now is 02:55 AM.