# boot problem and vi doesn't work to modify fstab



## red (May 17, 2011)

Hi, the only one thing I changed is that I moved the SATA cable from connector 3 to connector 0 on the motherboard.

Now at boot I got a root mount error, and the following error message

```
the following file system had an unexpected inconsistency
```


```
enter full pathname of shell or RETURN for /bin/sh
```


```
can't stat /dev/ad3s2e
...
...
can't stat /dev/ad3s2f
```

Typing *?* when I've to mount the root, I see that my actual disk is ad0, while system try to boot from ad3s2a. Thought this change is due to my change with SATA connector. Am I right?

Tried to run vi from terminal but it doesn't work, is an unknown command, and appears in /bin folder. 

Apart from trying to put back the SATA connector, may I do something?


----------



## nekoexmachina (May 17, 2011)

Did not get what you meant with 'appears in bin folder'. You could mount manually your /usr/ partition and use vi. 

If it does not work, you could try ed (ed should work any time, and it is in /bin, but it's hard to use).

Also I could suggest you to use /dev/ufs naming instead of device nodes to have no such a problem in the future.


----------



## Beastie (May 17, 2011)

There is no vi in /bin. It's in /usr/bin and since /usr is not mounted, the system can't access it.

If the system disk is now seen as ad0, then tell the system to boot ad0s2a instead of ad3s2a. You can then mount the rest (including /usr), fix the /etc/fstab file and reboot normally.

Perhaps using labels can spare you from facing further problems in the future.


----------



## wblock@ (May 17, 2011)

In single user mode, / is mounted readonly, so it has to be remounted before editing:
`# mount -u /`

There's a vi(1) in /rescue for emergencies.

Labels are a good idea, and here's my article on that: FreeBSD Labeled Filesystems


----------



## DutchDaemon (May 18, 2011)

[ off-topic follow-ups moved to separate thread @ http://forums.freebsd.org/showthread.php?t=23891 ]


----------

