getting device name of external hard drive?

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.

The 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 there a command to know what each device is referenced under, inside /dev/?
 
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:

Code:
/dev/ufs/mybackupdisk /mnt/backup ufs rw,noauto 0 0

Now you can mount the disk when needed simply by:
# mount /mnt/backup
 
kpa said:
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:

Code:
/dev/ufs/mybackupdisk /mnt/backup ufs rw,noauto 0 0

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

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:

Like you used this:
Code:
[FILE]/dev/ad0s1d[/FILE]

I don't know what is ad0s1d? Is it the filesystem default name? Or is it a device name?
 
Beeblebrox said:
Are you looking for something like this?
# gpart show
# gpart show -l

Yes, I needed those exact commands.

However, is there any way to figure out which one is which? Does gpart show the device name too? For my internal hard drive. I have three partitions. 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 partitions. One was to make it a swap partition, and make one as a linux partition and one to make it a freebsd FreeBSD partition.

I did all three. It kept telling me that I couldn't go on to the next step without setting a swap partition.

So, I am trying to figure out which one has my root system on it. I am assuming it's da0.
 
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.
 
/etc/fstab should have that information.

mount(8) and df(1) can also be used to find the device names of system partitions:
Code:
% 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
 
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?
 
Please start a new thread for new subjects. The title of this thread will not attract people with information on backup verification.
 
Back
Top