# Can't mount my hard disk



## Gio01 (Sep 26, 2011)

Hi, i need help.
when i try to mount the harddisk i receive this error:  


```
mount -t ufs /dev/ad8s1c /root/backup
mount: /dev/ad8s1c : Invalid argument
```

why?

who can explain me how to mount the harddrive? thank you


----------



## draco003 (Sep 26, 2011)

it would be helpful if you post the output of the following commands:

`$ ls /dev`

`$ df`


----------



## Gio01 (Sep 26, 2011)

there is output : 

```
2T8# egrep 'ad[0-9]|cd[0-9]' /var/run/dmesg.boot
ad4: 476940MB <WDC WD5000AAKX-001CA0 15.01H15> at ata2-master SATA300
ad8: 476940MB <SAMSUNG HD502HI 1AG01113> at ata4-master SATA300
GEOM_LABEL: Label for provider ad4s1a is ufsid/4e7f782ca629816c.
GEOM_LABEL: Label for provider ad8s1a is ufsid/4e0c922e88042c9a.
Trying to mount root from ufs:/dev/ad4s1a
GEOM_LABEL: Label for provider ad4s1a is ufsid/4e7f782ca629816c.
GEOM_LABEL: Label for provider ad8s1a is ufsid/4e0c922e88042c9a.
```


----------



## Gio01 (Sep 26, 2011)

```
2T8# egrep 'ad[0-9]|cd[0-9]' /var/run/dmesg.boot
ad4: 476940MB <WDC WD5000AAKX-001CA0 15.01H15> at ata2-master SATA300
ad8: 476940MB <SAMSUNG HD502HI 1AG01113> at ata4-master SATA300
GEOM_LABEL: Label for provider ad4s1a is ufsid/4e7f782ca629816c.
GEOM_LABEL: Label for provider ad8s1a is ufsid/4e0c922e88042c9a.
Trying to mount root from ufs:/dev/ad4s1a
GEOM_LABEL: Label for provider ad4s1a is ufsid/4e7f782ca629816c.
GEOM_LABEL: Label for provider ad8s1a is ufsid/4e0c922e88042c9a.
```


----------



## Gio01 (Sep 26, 2011)

```
2T8# ls /dev
acpi            cuad0.init      lpt0            stdout          ttyvc
ad4             cuad0.lock      lpt0.ctl        sysmouse        ttyvd
ad4s1           dcons           mdctl           ttyd0           ttyve
ad4s1a          devctl          mem             ttyd0.init      ttyvf
ad4s1b          devstat         net             ttyd0.lock      ufsid
ad4s1c          dgdb            net1            ttyp0           uhid0
ad8             dumpdev         net2            ttyv0           ukbd0
ad8s1           fd              net3            ttyv1           urandom
ad8s1a          fido            network         ttyv2           usb
ad8s1b          geom.ctl        nfs4            ttyv3           usb0
ad8s1c          io              nfslock         ttyv4           usb1
ata             kbd0            null            ttyv5           usb2
atkbd0          kbd1            pci             ttyv6           usb3
audit           kbd2            ppi0            ttyv7           usb4
console         kbdmux0         ptyp0           ttyv8           usb5
consolectl      klog            random          ttyv9           usb6
ctty            kmem            stderr          ttyva           xpt0
cuad0           log             stdin           ttyvb           zero
2T8# df
Filesystem  1K-blocks    Used     Avail Capacity  Mounted on
/dev/ad4s1a 464895904 1034978 426669254     0%    /
devfs               1       1         0   100%    /dev
```


----------



## draco003 (Sep 26, 2011)

Did you run [CMD=""]newfs[/CMD] on the ad8 ?


----------



## Gio01 (Sep 26, 2011)

tell me how


----------



## Gio01 (Sep 26, 2011)

```
mount: /dev/ad8 : Operation not supported by device
2T8# mount -t newfs /dev/ad8s1a /root/backup
mount: /dev/ad8s1a : Operation not supported by device
```


----------



## draco003 (Sep 26, 2011)

this command is destructive and it will erase all data you shouldn't use it on a partition with important data `# newfs` 

if you already have a ufs partition then there is no need to make a new file system 
be careful not to use it now, as it will delete everything
anyway it's used this way:
`# newfs /dev/ad8s1a`
but do not run that command now!


----------



## Gio01 (Sep 26, 2011)

```
2T8# mount -t ufs /dev/ad8s1a /root/backup
mount: /dev/ad8s1a : Operation not permitted
```
 there is problem


----------



## DutchDaemon (Sep 26, 2011)

Gio01, format your posts!


----------



## draco003 (Sep 26, 2011)

you need to be root to run
`# mount`

type `$ su`
and then enter root's password then mount


----------



## Gio01 (Sep 26, 2011)

I am sorry....  i have  typed 

```
su root
```
 and same error..


----------



## draco003 (Sep 26, 2011)

after switching to root
`$ su`

it still gives 
	
	



```
Operation not permitted
```


----------



## Gio01 (Sep 26, 2011)

Yes, it gives me 'operation not permitted'


----------



## draco003 (Sep 26, 2011)

can you try mounting to a different location
for example:

`# mount -t ufs /dev/ad8s1a /mnt/backup`


----------



## Gio01 (Sep 26, 2011)

same error

```
mount -t ufs /dev/ad8s1a /mnt/backup
mount: /dev/ad8s1a : Operation not permitted
```


----------



## draco003 (Sep 26, 2011)

Ok try `# fsck -y /dev/ad8s1a`

then `# mount -t ufs /dev/ad8s1a /mnt/backup`


----------



## wblock@ (Sep 26, 2011)

Use file(1) to find out what is really on that partition.
`# file -s /dev/ad8s1a`


----------



## fluca1978 (Sep 26, 2011)

I see you are using GEOM on the ad4 and ad8, what are you using it for? 
Besides geom, the only cause for having a permission error are that you are not root, you have already mounted something on the same target directory or there is a jail and/or a security level enabled.


----------



## Gio01 (Sep 26, 2011)

thank you for help i have fixed thank you much!
The hard disk is repaired 
now other question:
i can set up primary hard disk ad8 and ad4 the secondary?


----------



## mix_room (Sep 26, 2011)

Gio01 said:
			
		

> thank you for help i have fixed thank you much!
> The hard disk is repaired



How? Please tell people how you solved your problem so that others can profit aswell. The forum is for information sharing, not for personal help.


----------



## Gio01 (Sep 26, 2011)

i have used this :

```
Ok try # fsck -y /dev/ad8s1a

then # mount -t ufs /dev/ad8s1a /mnt/backup
```


----------



## draco003 (Sep 26, 2011)

Congrats, Gio01!

I'm glad it's working


----------

