# cannot mount root panic 9.0-BETA2



## grigorovl (Sep 23, 2011)

Hello, I installed the 9.0-BETA2 of PC-BSD which uses the GENERIC kernel (still no PC-BSD kernel, I think). Everything was fine until I decided to recompile the kernel and then I can't boot anymore, I get panic on mounting root. I can't enter in Single User mode or any other modes.

This is how I configured the disk in install:
/boot UFS 1024MB
/ /usr /var ZFS about 920GB
swap 4096GB

Right before it stops to mountroot> a few lines above it lists the disks details (it's a 1TB WD Caviar Black):

```
ada0 at ata2 bus 0 scbus1 target 0 lun0
ada0: <name of disk> ATA-8 SATA 3.X ...more info
ada0: 150MB transfers... more info
ada0: 953869 ... more info
ada0: Previouly was known as ad4
```

When I try to boot, it stops and asks for entry into mountroot> and I only get one try at it before it goes to db> and I have to reboot. Pressing ? shows this:

```
List of GEOM managed disk devices:
label/swap0 ufsif/4e79ff63efe9f8f4 label/boot0 ada0s1d ada0s1b ada0s1a ada0s1 ada0
```

I have tried the following command and they all don't work and result in error: 22:

```
ufs:/dev/ada0s1a
zfs:/dev/ada0
zfs:/dev/ada0s1
zfs:/dev/ada0s1a
zfs:/dev/ada0s1b
zfs:/dev/ada0s1d
zfs:/dev/ad4s1
zfs:/dev/ad4s1b
zfs:tank
zfs:zroot
```

At the boot menu, I tried to escape to loader prompt, but it cannot find

```
boot GENERIC
boot /boot/kernels/GENERIC
```

The following results in same error with mounting root:

```
OK boot kernel.old

OK unload
OK boot /boot/kernel.old/kernel
```

I only removed wifi nics, eth nics, compat for 4 5 6 7, and all raid drives from my custom kernel (kept all sata and scsi entries), installed, rebooted and got this. Booting from the PC-BSD live usb list the current drive as ada0s1, but doesn't go in further.

Please advise what I can do to get my system back without reinstalling. Cheers.

EDIT: http://www.daemonforums.org/showthread.php?p=34362 this seems to be similar with zfs on root.


----------



## wblock@ (Sep 23, 2011)

grigorovl said:
			
		

> At the boot menu, I tried to escape to loader prompt, but it cannot find
> 
> ```
> boot GENERIC
> ...



Unload the new kernel first (not sure that's required, but it won't hurt).  Then give the full path to the old kernel.
[cmd="OK"]unload[/cmd]
[cmd="OK"]boot /boot/kernel.old/kernel[/cmd]


----------



## grigorovl (Sep 23, 2011)

Same error happens. I think the filesystem may be damaged, because I did a hard restart following the first reboot with the new kernel. It booted into a blank screen (which was most likely an xorg issue).

I had a similar problem with a FreeNAS server and a hard reset. I had to run fsck to get it to boot properly. The problem here is that I can't get into a shell environment. I am lead to mountroot>

If there is a way to get my data out of there I am willing to reinstall, but I rather just fix it. Is there anyway to run fsck or something that will help? I think the hard restart might have had something to do with it. Please advise further.


----------



## zodias (Sep 23, 2011)

You will want to use live usb and drop to fixit shell. Then you can run 
	
	



```
# fsck -y -t ufs /dev/ada0xxx
```
 to fix the ufs partition. 
As for the zfs pool, you can try 
	
	



```
# zpool import your_pool_name
```
, mount external usb hdd or other media and you can copy the data from the pool on it.


----------



## grigorovl (Sep 23, 2011)

Further bad news... I ran 8.2 livefs and then went to fixit and ran

```
fsck -y -t ufs /dev/ad4s1a
```
It fixed some issues, but I am still led to mountroot> after reboot.

After loading zfs.ko in fixit, I run:

```
Fixit# zpool import
pool: tank0
id: 6629877018057362585
state: UNAVAIL
status: The pool was last accessed by another system.
action: The pool cannot be imported due to damaged devices or data.
see: http://www.sun.com/msg/ZFS-8000-EY
config:
 tank0 UNAVAIL never version
 ad4s ONLINE
```

P.S. 8.2 was listing the drive as ad4 and 9.0 lists it as ada0. What can I try next? Is the data really damaged beyond repair from a simple hard reset? This never happened in Win for me, and it's a shame that it happened from 1 hard reboot in FreeBSD...

```
Fixit# zpool import -R /mnt -f tank0
cannot import 'tank0': pool is formatted using a newer ZFS version
```

I was able to get access to the drive from 9.0-BETA2 .img file. I wonder if there is any way to repair the system now.


----------



## grigorovl (Sep 23, 2011)

You can mark thread as SOLVED. I was able to boot and get into the system with:

```
mountroot> zfs:tank0
```
Lesson learned, and I will not use ZFS anymore.


----------

