# Help - system boot failure



## psycho (Nov 23, 2009)

Hi.
I use command 
	
	



```
dhclient re0
```
 for connecting to Internet.
I wanted to speed up whole process by adding this line of code to /etc/rc.conf because I thought it would done it automatically on booting.
Now I have infinite loop, because the steps of "dhclient re0" are repeating and boot can't continue.


----------



## SirDice (Nov 23, 2009)

How did you add it?

It should be this:

```
ifconfig_re0="DHCP"
```


----------



## fender0107401 (Nov 23, 2009)

try single user model and edit rc.conf


----------



## psycho (Nov 23, 2009)

@ fender0107401: tnx I'll try that.
@SirDice: no I just added command 
	
	



```
dhclient re0
```
 to /etc/rc.conf


----------



## DutchDaemon (Nov 23, 2009)

/etc/rc.conf is not a simple shell script! You really need to put 
	
	



```
ifconfig_re0="DHCP"
```
 in there, as suggested.


----------



## SirDice (Nov 23, 2009)

psycho said:
			
		

> @SirDice: no I just added command
> 
> 
> 
> ...



Don't ever do that again 

/etc/rc.conf should contain various variables to set options, it should not contain commands.


----------



## psycho (Nov 23, 2009)

well now I know. 

Ok I tryed Single User Mode and I have succesfully booted into the system but edit/pico commands don't work and when I was shutting down system, it tried to write some Log file, and then error occured with msg that this is Read-only mode


----------



## SirDice (Nov 23, 2009)

psycho said:
			
		

> well now I know.
> 
> Ok I tryed Single User Mode and I have succesfully booted into the system but edit/pico commands don't work and when I was shutting down system, it tried to write some Log file, and then error occured with msg that this is Read-only mode



In single user mode, only the root filesystem is mounted. And it's mounted read-only. To fix that:


```
fsck -y
mount -u /
mount -a -t ufs
```
After that edit/pico/vi should work and you will be able to edit /etc/rc.conf.


----------



## psycho (Nov 23, 2009)

o tnx , solved problem.
Can you SirDice be so kind to explain what this piece of code does?


----------



## jalla (Nov 23, 2009)

psycho said:
			
		

> o tnx , solved problem.
> Can you SirDice be so kind to explain what this piece of code does?



I suspect he can, but you really should see the manpages for whatever commands here you don't understand.


----------



## tangram (Nov 23, 2009)

psycho said:
			
		

> o tnx , solved problem.
> Can you SirDice be so kind to explain what this piece of code does?



Have fun:
rc.conf(5)
ifconfig(8)


----------



## Beastie (Nov 23, 2009)

I think he rather means the fsck and mount commands.

fsck does a *f*ile *s*ystem *c*onsistency *c*heck and answers *y*es to all questions asked.

Then you unmount the root partition (since it was mounted read-only by default).

Then you mount *a*ll partitions of the *ufs* *t*ype (to ensure only system partitions are mounted).

fsck(8)
mount(8)


----------



## tangram (Nov 23, 2009)

Oh yeah...


```
# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a
```

This checks the file systems, remounts / read/write and mounts all the other UFS file systems referenced in /etc/fstab.


----------



## SirDice (Nov 23, 2009)

Beastie said:
			
		

> Then you unmount the root partition (since it was mounted read-only by default).


Actually, you remount the root filesystem with "mount -u /" (You cannot unmount a filesystem that's in use  ) with the settings in /etc/fstab (which usually means read/write).


----------



## Beastie (Nov 23, 2009)

Of course, yes. You're exactly right. My bad.


----------

