# Unable to add new HDD - Please help!



## Mr-T (Jun 4, 2011)

Hello,

I've installed FreeBSD onto a 4GB USB flash stick, and am quite happy with the OS (I come from a RHEL background of systems). Until I can afford 4 x 2TB drives for a ZFS pool, I planned on utilising a brand new 250GB HDD I have, as a main storage partition. Unfortunately I cannot for the life of me work out how to get this drive working?

My machine is a HP ProLiant N36L, which has recently become popular as it had a AU$200 price tage for a little over a week. In the BIOS I'm able to see both the USB flash drive, and the 250GB HDD. If I *egrep* through the dmesg.boot file I'm able to see an ad6 device which appears to be the 250GB HDD.


```
[root@homenas ~]# egrep 'ad[0-9]|cd[0-9]|da[0-9]' /var/run/dmesg.boot
ad6: 238475MB <VB0250EAVER HPG0> at ata3-master UDMA100 SATA 3Gb/s
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0SMP: AP CPU #1 Launched!
da0: 
da0: 40.000MB/s transfers
da0: 3736MB (7653312 512 byte sectors: 255H 63S/T 476C)
Trying to mount root from ufs:/dev/da0s1a
```

But alas, in fdisk and /dev there is nothing (that I can see) that relates to this drive, so I'm unable to format it, partition it, or label it!


```
[root@homenas ~]# fdisk 
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=476 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=476 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 7646877 (3733 Meg), flag 80 (active)
	beg: cyl 0/ head 1/ sector 1;
	end: cyl 475/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
```


```
[root@homenas ~]# ls /dev  
acpi		consolectl	devstat		kbd1		mem		random		ttyv1		ttyv8		ttyvf		ugen3.2		xpt0
ata		ctty		dgdb		kbd2		nfslock		snp		ttyv2		ttyv9		ufsid		ugen4.1		zero
atkbd0		da0		fd		kbdmux0		null		stderr		ttyv3		ttyva		ugen0.1		ugen5.1		zfs
audit		da0s1		fido		klog		pass0		stdin		ttyv4		ttyvb		ugen0.2		ukbd0
bpf		da0s1a		geom.ctl	kmem		pci		stdout		ttyv5		ttyvc		ugen1.1		urandom
bpf0		dcons		io		log		ptmx		sysmouse	ttyv6		ttyvd		ugen2.1		usb
console		devctl		kbd0		mdctl		pts		ttyv0		ttyv7		ttyve		ugen3.1		usbctl
[root@homenas ~]#
```


```
[root@homenas ~]# mount
/dev/da0s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
[root@homenas ~]#
```

Please help, any assistance would be much appreciated!


----------



## SirDice (Jun 4, 2011)

Handbook: 18.3 Adding Disks


----------



## jb_fvwm2 (Jun 4, 2011)

```
man gjournal # EXAMPLES section
```
 ... may be helpful also. There is also a "-f file" fdisk method one should know about.


----------



## Mr-T (Jun 4, 2011)

SirDice said:
			
		

> Handbook: 18.3 Adding Disks



I've discovered this page, but am confused.



> Login as user root. After you have installed the drive, inspect /var/run/dmesg.boot to ensure the new disk was found.



So I assume I've performed this step correctly, as the disk is appearing as device 
	
	



```
ad6 238475MB <VB0250EAVER HPG0> at ata3-master UDMA100 SATA 3Gb/s
```
 although I would have assumed that it would be ad0 (as the USB drive is da0)

Assuming what I've assumed is correct, the following piece is what confuses me.



> Continuing with our example, the newly added drive will be da1 and we want to mount it on /1 (if you are adding an IDE drive, the device name will be ad1).



Is it safe to assume that if the *egrep* I showed earlier was run on the guide's dmesg.boot file, it would show the guide's new drive as ad1?


Cheers, Mike.


----------



## tingo (Jun 4, 2011)

OP: which version of FreeBSD are you running? If you are running FreeBSD 8.x, yoys should be able to use gpart(8).`# gpart show ad6` will tell you about ad6, and `# gpart show da0` about da0.


----------



## Mr-T (Jun 4, 2011)

tingo said:
			
		

> OP: which version of FreeBSD are you running? If you are running FreeBSD 8.x, yoys should be able to use gpart(8).`# gpart show ad6` will tell you about ad6, and `# gpart show da0` about da0.



Yeah, I'm running 8.2, although *gpart* shows no info for ad6.


```
[root@homenas ~]# gpart show ad6
gpart: No such geom: ad6.

[root@homenas ~]# gpart show da0
=>     63  7653240  da0  MBR  (3.6G)
       63  7646877    1  freebsd  [active]  (3.6G)
  7646940     6363       - free -  (3.1M)

[root@homenas ~]#
```


----------



## wblock@ (Jun 4, 2011)

Mr-T said:
			
		

> So I assume I've performed this step correctly, as the disk is appearing as device
> 
> 
> 
> ...



IDE drives (and SATA drives in IDE emulation) are given static numbers based on the controller.  Unless you build a custom kernel, and it's not worth it for dynamic disk numbers.

Don't know why it's not showing up in /dev after it shows up in dmesg(8).  Some RAID controllers might be weird.


----------



## _martin (Jun 4, 2011)

Mr-T said:
			
		

> .. although I would have assumed that it would be ad0 (as the USB drive is da0)



Do have a quick look into handbook as suggested, a lot is explained there. Name of the IDE disk also depends on the controller, you can check it with atacontrol(8), for example: 

`#  atacontrol list`

```
ATA channel 2:
    Master:      no device present
    Slave:       no device present
ATA channel 3:
    Master:  ad6 <ST3160813AS/CC2F> SATA revision 2.x
    Slave:       no device present
ATA channel 4

--<output omitted>--
```

Neither fdisk nor gpart work if you don't have the DSF (device special file) present under /dev. Before checking OS related stuff, can you safely say (and you checked it) there is no problem with hardware itself? Cabling, IDE slot, disk, etc. ? I did experience the very same problem with a faulty SATA cable (system sees them as IDE disks due to BIOS settings). 

It might be worth detaching and attaching the ATA channel with atacontrol too.


----------



## Mr-T (Jun 5, 2011)

matoatlantis said:
			
		

> It might be worth detaching and attaching the ATA channel with atacontrol too.



Well it looks like this may have been the key. I detached, attached, and can now see ad6 in the /dev directory.
I used sysinstall and can now format the drive.

Thank you all for your support.


----------

