# mountroot



## mrmike19597 (May 6, 2014)

Hey all,

I was in a tornado last week and my computer was damaged..

All I could save was the hard drive... and ordered a new motherboard, CPU, Memory.. Everything works fine.. but it is stuck at:


```
Trying to mount root from ufs:/dev/ad12s1a

mountroot> _
```

I have tried google and searching in this forum and unable to find out what to type.. I tried samples I could find but they didn't do anything. Tried typing: `mount ufs:/dev/ad0s1a` no luck.. How can I find out what code/numbers to use? Please help and thank you.


----------



## obsigna (May 6, 2014)

Try ufs:/dev/ada0s1a

Once booted, you have to edit /etc/fstab accordingly.


----------



## mrmike19597 (May 6, 2014)

I tried that, still no luck, just keeps repeating mountroot> _

Any other suggestions? Thanks.


----------



## wblock@ (May 6, 2014)

That would be FreeBSD 8 or earlier, with static drive numbering.  At the prompt, typing ? should show a list of discovered devices.  From that, the actual drive number can be determined.  Don't type mount, just ufs:/dev/ad_8_s1a.


----------



## mrmike19597 (May 6, 2014)

When I type ? it just repeats mountroot> _

It isn't listing any devices.


----------



## mrmike19597 (May 6, 2014)

The list is blank.. would it be because I didn't put in a CD ROM Drive?


----------



## obsigna (May 6, 2014)

Look into the BIOS settings of your new board. Does it still emulate IDE for SATA drives, or does it use AHCI? In the latter case, the device ids of the SATA drives are adaX and X starts at 0 for the first recognized HD in the system. Note the second a, so the first HD in the system would be ada0 and not ad0, and the slice a on that disk would be ada0s1a.


----------



## mrmike19597 (May 6, 2014)

Now only screen I am getting is:


```
Default: 0:ad(0,a)/boot/loader
boot: _
```

Not sure what to put in.


----------



## mrmike19597 (May 6, 2014)

obsigna said:
			
		

> Look into the BIOS settings of your new board. Does it still emulate IDE for SATA drives, or does it use AHCI? In the latter case, the device ids of the SATA drives are adaX and X starts at 0 for the first recognized HD in the system. Note the second a, so the first HD in the system would be ada0 and not ad0, and the slice a on that disk would be ada0s1a.



I'm not seeing anything in Bios about this, I see SATA: WDC plus a lot of #'s for hard drive 
I do see AHCI when I turn power on and FreeBSD starts to load.


----------



## obsigna (May 6, 2014)

mrmike19597 said:
			
		

> obsigna said:
> 
> 
> 
> ...



What FreeBSD version is on that disk?

If it is 8 or even less, then the AHCI kernel module is not loaded by default. If you could switch the BIOS to emulate SATA as IDE, that would be the easiest way to get your disk working. If not, that would not exactly be a big deal, but it would be a little bit more involved to get the disk running. In this latter case (and FreeBSD 8), you need to start the system from a FreeBSD 9 or 10 Live CD, mount the boot volume of your hard drive to the mountpoint /mnt and add the following line to /mnt/boot/loader.conf.

```
ahci_load="YES"
```
.

If it is FreeBSD 7 (or less), then you want to consider to set up a new system (FreeBSD 10) on a separate disk, and copy the data from your old disk to the new installation.


----------



## mrmike19597 (May 6, 2014)

So if I am on FreeBSD 7 I have to reinstall? I found it in BIOS and set to IDE but still can't find the device number, typing ? just shows no devices listed.


----------



## mrmike19597 (May 6, 2014)

Oh and it is version 8


----------



## mrmike19597 (May 6, 2014)

Sorry I meant I am on 7.3


----------



## obsigna (May 6, 2014)

mrmike19597 said:
			
		

> So if I am on FreeBSD 7 I have to reinstall?  I found it in BIOS and set to IDE ...


(Have-To) No, since you found how to set the BIOS to IDE. Anyway 7.3 is quite outdated, and you want to consider to make the switch to FreeBSSD 10 - think on all the security enhancements in the last 4 years.



			
				mrmike19597 said:
			
		

> ... but still can't find the device number, typing ? just shows no devices listed.


Start from a FreeBSD 10 Live-CD, at the install menu press escape, login as root and then issue the command `gpart show`. This should tell you exactly the device identifiers of your HD. The disk is there, otherwise you wouldn't even come to see the mountroot> prompt.


----------



## mrmike19597 (May 6, 2014)

Can I put FreeBSD Live on USB device and boot from it? New motherboard I got doesn't take connection to my old CD ROM, need one that is for SATA.


----------



## wblock@ (May 6, 2014)

The problem is that FreeBSD 10 uses relative disk numbers.  The first disk is always ada0.  That is different from FreeBSD 7 and (I think) 8, which used absolute disk device numbers based on the port.  Using Scroll Lock to scroll back in the kernel boot message will show messages like

```
ada0: Previously was known as ad4
```

Since the original machine is gone and the drive may have been damaged also, I personally would install FreeBSD 10 on a new drive.  Then connect the old one and copy data into a backup directory on the new drive, then set up the new FreeBSD 10 system using data from the old one.


----------



## wblock@ (May 6, 2014)

mrmike19597 said:
			
		

> Can I put FreeBSD Live on USB device and boot from it? New motherboard I got doesn't take connection to my old CD ROM, need one that is for SATA.



Yes, there are USB images available from http://www.freebsd.org.  However, I recommend mfsBSD instead, which works better and has some additional utilities like rsync.


----------



## mrmike19597 (May 6, 2014)

My BIOS also has shell access to boot from, lists files, but wonder if I can find devices in that. Thanks much for the help!


----------



## wblock@ (May 6, 2014)

This entire thread would benefit from seeing the exact messages produced.  A BIOS shell might be UEFI, which will not help with FreeBSD device numbering.


----------



## mrmike19597 (May 6, 2014)

Ok thanks, going to try FreeBSD Live, The hard drive is fine and no damage, I had it tested in another box and it booted, just won't for my major change of replacement.


----------



## mrmike19597 (May 7, 2014)

Ok, I got FreeBSD 10 CD in and issued the gpart show command.

Got this on my screen: 
	

	
	
		
		

		
			





And I went back to the rootmount> screen and tried:


```
ufs:/dev/ada0

ufs:/dev/ada0s1
```

But it just keeps repeating to rootmount> _ .. Can someone please tell me what I am typing wrong? Thank you.


----------



## mrmike19597 (May 7, 2014)

http://i60.tinypic.com/2w688xv.jpg Here is direct link to full size picture.


----------



## wblock@ (May 7, 2014)

Unfortunately, this tells us nothing useful.  As I said above, FreeBSD 10 will always show the first drive as ada0.  Use `dmesg | less -p Previously` to find the static device number.


----------



## mrmike19597 (May 7, 2014)

Am I looking in the right place when I see these numbers here http://i58.tinypic.com/2mfdip.jpg


----------



## obsigna (May 7, 2014)

mrmike19597 said:
			
		

> Am I looking in the right place when I see these numbers here http://i58.tinypic.com/2mfdip.jpg



No. The static drive numbers are those without the second a before the digit(s), and usually on a new installation begin at 4, for example ad4s1a. Device identifiers like ada0 (note the second a) are AHCI drive identifiers.

Please show the output of the following command `ls -l /dev/ad*`


----------



## mrmike19597 (May 7, 2014)

Here is the output: http://i60.tinypic.com/2q0qbr4.jpg

Thank you


----------



## obsigna (May 7, 2014)

mrmike19597 said:
			
		

> Here is the output: http://i60.tinypic.com/2q0qbr4.jpg
> 
> Thank you



OK, now still on FreeBSD 10 Live, edit the file /etc/fstab on your hard disk to correspond to the correct device numbers.

1. Mount the root slice / to the mountpoint /mnt
`mount /dev/ad4s1a /mnt`

2. Edit the fstab file using the easy editor ee(1), replacing all occasions of ad12 with ad4
`ee /mnt/etc/fstab`

3. Leave the editor by typing <ctrl>-<[> and save the changes.

4. Shutdown the computer, remove the CD, and restart.


----------



## mrmike19597 (May 7, 2014)

Trying step 1 and I get this error:


```
mount: /dev/ad4s1a: R/W mount of / denied. File system is not clean.
```


----------



## obsigna (May 7, 2014)

mrmike19597 said:
			
		

> Trying step 1 and I get this error:
> 
> 
> ```
> ...



Start again with the FreeBSD 10 CD, then run the file system check on the ufs volumes:

`# fsck_ufs -fy /dev/ad4s1a`
`# fsck_ufs -fy /dev/ad4s1d`
`# fsck_ufs -fy /dev/ad4s1e`
`# fsck_ufs -fy /dev/ad4s1f`

Then restart.


----------



## mrmike19597 (May 7, 2014)

Thank you so much, my computer now boots, YOU'RE AWESOME!! Do you know if I need to change anything for internet to work after all this mess? Because it isn't connecting to the internet. I used sysinstall to configure the network but it didn't connect and modem  isn't seeing the device. Just making me wonder if I should get a network card and not use the one built in the motherboard.


----------



## mrmike19597 (May 7, 2014)

New One RealTek Lan RTL8111E

Old One RealTek Lan RTL8111DL

I'm guessing my new network adapter isn't supported.


----------



## obsigna (May 7, 2014)

mrmike19597 said:
			
		

> New One RealTek Lan RTL8111E
> Old One RealTek Lan RTL8111DL
> 
> I'm guessing my new network adapter isn't supported.



RealTek provides drivers for older FreeBSD releases: http://www.realtek.com/Downloads/do...5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2.

Recent FreeBSD releases support this NIC out of the box. This is after all another reason to strongly consider to upgrade your FreeBSD installation, like @wblock@ suggested.


----------



## n1tr0us (Mar 16, 2015)

Guys, you are awesome! Thank you so much!+)))) My system was booted too after replacing HDD with FreeBSD 6.2 in another PC.


----------

