# deleted content of rc.conf, now machine continuously reboots



## Vitamin (Jan 31, 2012)

Hi,

Not sure what to do. I hope I don't have to re-install.

Any suggestions?


----------



## phoenix (Jan 31, 2012)

At the loader menu, press 4, boot to single mode.

At the prompt, remount the root filesystem read-write:
`# mount -u /`

Then edit /etc/rc.conf and reboot.


----------



## SirDice (Jan 31, 2012)

I wonder what you did though. Even if you removed the entire file the system would still boot normally. If there are any errors in rc.conf it would complain loudly but still boot.


----------



## Vitamin (Jan 31, 2012)

phoenix said:
			
		

> At the loader menu, press 4, boot to single mode.
> 
> At the prompt, remount the root filesystem read-write:
> `# mount -u /`
> ...



Thanks for the reply.

I cannot get to the prompt. It reboots automatically each time. I tried using the live cd, but it says the file is read only.

What default info is in the rc.conf file?
1) enabling kdm
2) defaultrouter?
3) host_name?



			
				SirDice said:
			
		

> I wonder what you did though. Even if you removed the entire file the system would still boot normally. If there are any errors in rc.conf it would complain loudly but still boot.



Let's just say I learned the difference between adding an entry in a file using the vi editor versus using echo and redirecting the output to a file.


----------



## SirDice (Jan 31, 2012)

Vitamin said:
			
		

> It reboots automatically each time.


It reboots in single user mode?

Are you sure the hardware is still OK?


----------



## throAU (Jan 31, 2012)

If the system is totally broken, you could perhaps boot from a live-cd (mfsbsd?) mount your root filesystem and fix the file/examine the partition for further damage?


----------



## Vitamin (Jan 31, 2012)

SirDice said:
			
		

> It reboots in single user mode?
> 
> Are you sure the hardware is still OK?



It would continually reboot. It would begin to start KDE, but it reboot every time.
I even tried to skip the process that starts KDE, by using ctl+alt+F1, to get to the prompt, but it would still reboot.

The hardware is a virtual machine. It was working fine prior to my screw up




			
				throAU said:
			
		

> If the system is totally broken, you could perhaps boot from a live-cd (mfsbsd?) mount your root filesystem and fix the file/examine the partition for further damage?



If you're referencing the same steps suggested by phoenix, then it still does not work after I tried that


----------



## UNIXgod (Jan 31, 2012)

Overheating components will force a reboot. Check your processors heatsink and confirm proper airflow in the box (i.e. no dustbunnies and all fans are working)


----------



## phoenix (Jan 31, 2012)

Boot to single-user mode.

Mount the / filesystem read-write.

Edit /etc/rc.conf and comment out the *kdm4_enable="YES"* line.

Boot to multi-user mode.

Fix your graphics setup.

It sounds like the Xorg config is wrong, and going into graphics mode is tweaking something nasty that reboots the system.


----------



## Vitamin (Feb 1, 2012)

UNIXgod said:
			
		

> Overheating components will force a reboot. Check your processors heatsink and confirm proper airflow in the box (i.e. no dustbunnies and all fans are working)


it's a virtual machine.



			
				phoenix said:
			
		

> Boot to single-user mode.
> 
> Mount the / filesystem read-write.
> 
> ...



I was able to boot in single user mode. Then *mount /*. But neither vi or ee is working. It says

```
ee: not found
vi: not found
```


----------



## phoenix (Feb 1, 2012)

If /usr is a separate filesystem, you'll have to mount that as well.


----------



## SirDice (Feb 1, 2012)

Yes, if it's a 'standard' FreeBSD install:

```
fsck -y
mount -u /
mount -a -t ufs
swapon -a
```
You should now be able to edit pretty much everything.


----------

