# System won't boot and I think PF is the cause



## hpg (Jul 31, 2013)

Hello all,

Being that the install of PF is one of the few things that have recently changed on my system, I believe this may be the cause of my troubles.  After rebooting, I got the following messages:

```
(ada0:ata2:0:0:0): READ_DMA. ACB: c8 00 5f 7d 0b 40 00 00 00 00 80 00
(ada0:ata2:0:0:0): CAM status: ATA Status Error
(ada0:ata2:0:0:0): ATA status: 51 (DRDY SERV ERR), error: 40 (UnC )
(ada0:ata2:0:0:0): RES: 51 40 5f 7d 0b 00 00 00 00 80 00
(ada0:ata2:0:0:0): Retrying command
```
I would continue getting these messages until it eventually dumped me into single user mode.
Once in single user mode, I decided I would disable PF in /etc/rc.conf but the file system is mounted as read only, and when I tried to mount / as read/write I got the following error:

```
mount: /dev/ad4s1a: R/W mount of / denied. Filesystem is not clean - run fsck.:
Operation not permitted
```

I tried to run `fsck` on /dev/ad4s1a and got the same errors from the initial boot. I then tried to mount /dev/ad4s1a after booting from a live CD but no luck there. Any thoughts on what steps I can take from here would be greatly appreciated.

Thanks


----------



## wblock@ (Jul 31, 2013)

It's not PF.  There is a problem with the disk.  Boot mfsBSD and run `smartctl -a /dev/ada0 | less -S -p Reallocated_Sector` to see if the drive has been reallocating failed sectors.

If the hardware is okay, then try fsck(8).  You don't say what options you used, or why the drive became ada4.


----------



## hpg (Aug 1, 2013)

Ok, so I booted from mfsbsd and ran:

```
smartctl -a /dev/ada0 -s on : less -S -p Reallocated_Sector
```
and got the following values in the Reallocated_Sector_Ct row:

```
VALUE    WORST    THRESH    TYPE      UPDATED
100      100      036       Pre-fail  ALways
```

I then tried to run `fsck -y -t ufs /dev/ad4s1a` and received:

```
(ada0:ata2:0:0:0): READ_DMA. ACB: c8 00 5f 7d 0b 40 00 00 00 00 80 00
(ada0:ata2:0:0:0): CAM status: ATA Status Error
(ada0:ata2:0:0:0): ATA status: 51 (DRDY SERV ERR), error: 40 (UnC )
(ada0:ata2:0:0:0): RES: 51 40 5f 7d 0b 00 00 00 00 80 00
(ada0:ata2:0:0:0): Retrying command
```

After the previous messages are repeated many times, it will print that it can't read a particular block and then list the sectors that could not be read.


----------



## throAU (Aug 1, 2013)

Just to back up the above:  its not `pf` 

You have failed hardware (power supply insufficient, dead/dying drive or dodgy SATA cable).

From memory/prior experience (though many years ago) the only thing during boot that it is possible to screw up with pf is if you block DNS resolution, in which case Sendmail will cause boot to pause for quite a long time until initial name lookups that it tries to do time out.

edit:
The two give away lines are these:

```
ada0:ata2:0:0:0): [B]READ_DMA[/B]. ACB: c8 00 5f 7d 0b 40 00 00 00 00 80 00
ada0:ata2:0:0:0): CAM status: [B]ATA Status Error[/B]
```

DMA problems and ATA problems are generally hardware.


----------



## wblock@ (Aug 1, 2013)

hpg said:
			
		

> Ok, so I booted from mfsbsd and ran:
> 
> ```
> smartctl -a /dev/ada0 -s on : less -S -p Reallocated_Sector
> ...



Scroll right to see the actual value in the far right column.


----------



## hpg (Aug 2, 2013)

Thanks for the replies.  Any suggestions as to how I can recover the files on this disk?  All of this occured before I set up a RAID array or any kind of failover solution, so I'm kind of in a bad spot.


----------



## wblock@ (Aug 2, 2013)

Replace the cable on the off chance that is the problem.


----------

