# getting device name of external hard drive?



## hockey97 (Jun 19, 2012)

Hi, I  am trying to get the device name form the freebsd FreeBSD 8.1 computer.

I was told to type these commands:

`# grep da /var/run/dmesg.boot`
`# camcontrol devlist`

when I do this I get the name of the device. Like Western Digital or Segate etc. I was looking towards the device reference name. I don't know the proper word to call it; like dao1, something like that. The reason is that I want to run a backup command to back up my current internal drive and copy it over to my external hard drive.

*T*he example of the name is: /dev/ad0s1d. I don't get how I would know what ad0sld is? I want to know my internal hard drive and external hard drives device name under /dev/ so I can reference it properly. I would need to back up a.k.a. use dump to dump the files from my internal hard drive to my external hard drive. 

However, I have know clue how to figure which is which. Is the*re* a command to know what each device is referenced under, inside /dev/?


----------



## kpa (Jun 19, 2012)

Label the filesystem and you'll always know what it is.

`# tunefs -L mybackupdisk /dev/ad0s1d`

You can then use that name in /etc/fstab:


```
/dev/ufs/mybackupdisk /mnt/backup ufs rw,noauto 0 0
```

Now you can mount the disk when needed simply by:
`# mount /mnt/backup`


----------



## hockey97 (Jun 19, 2012)

kpa said:
			
		

> Label the filesystem and you'll always know what it is.
> 
> `# tunefs -L mybackupdisk /dev/ad0s1d`
> 
> ...



I already have the external hard drive mounted with the name username. I created a folder and every time it mounts it mounts to that username folder. What I am saying in the command line when I am using dump I need to know the name I need to use to dump a copy. First off I don't know the name of my internal hard drive. It's assigned automatically. I need to know the internal and external hard drives names. So I can reference them in the dump commands.

I guess what I am saying is I don't know the file name to begin with:

*L*ike you used this: 
	
	



```
[FILE]/dev/ad0s1d[/FILE]
```

I don't know what is ad0s1d? Is it the filesystem default name? Or is it a device name?


----------



## Beeblebrox (Jun 19, 2012)

Are you looking for something like this?
`# gpart show`
`# gpart show -l`


----------



## hockey97 (Jun 19, 2012)

Beeblebrox said:
			
		

> Are you looking for something like this?
> `# gpart show`
> `# gpart show -l`



Yes, I needed those exact commands.

However, is the*re* any way to figure out which one is which? Does gpart show the device name too? *F*or my internal hard drive. I have three parti*t*i*o*ns. One of them is my root system. Another had something like a linux system type file system. When installed freebsd FreeBSD 8.1 I got options when creating parti*t*i*o*ns. *O*ne was to make it a swap parti*t*i*o*n, and make one as a linux parti*t*i*o*n and one to make it a freebsd FreeBSD parti*t*i*o*n. 

I did all three. It kept telling me that I couldn't go on to the next step without setting a swap parti*t*i*o*n. 

So, I am trying to figure out which one has my root system on it. I am assuming it's da0.


----------



## phoenix (Jun 19, 2012)

When in doubt, read the man page: gpart(8).  

"show" shows each device with the partitions on each one.

"show -l" shows the same info as above, but also lists any labels on the partitions.


----------



## wblock@ (Jun 19, 2012)

/etc/fstab should have that information.

mount(8) and df(1) can also be used to find the device names of system partitions:

```
% mount
/dev/ada0p2 on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
% df -h
Filesystem     Size     Used    Avail Capacity  Mounted on
/dev/ada0p2     13G     1.4G      11G    11%    /
devfs          1.0K     1.0K       0B   100%    /dev
```


----------



## hockey97 (Jun 20, 2012)

How would someone test their backups if the backups work properly? I would love to make sure my backups are in good working order before I depend on them. Any ideas on how to test the backups made?


----------



## wblock@ (Jun 20, 2012)

Please start a new thread for new subjects.  The title of this thread will not attract people with information on backup verification.


----------

