# mount WD 1TB usb hard drive



## djemmers (Oct 30, 2009)

hi,

At work "somebody" dropped our backup hard disk for our freebsd server (mails and files)
I bought a new one but it seems it doesn't get recognized by the server.
btw I am a noob and have to fix it.

en /dev I don't see any new devices comming up when I plug in the new HD (that did happend with the old one)
So I am sure the backup script won't work as it starts with something like " mount dev/da2s1 /backup
and than starts backing up all the desired files...

can anyone tell me how to make sure mounting the new external HD works?
or tell me what to read?

greetings


----------



## gentoobob (Oct 30, 2009)

unplug the device, wait 2 or 3 seconds, plug it back in, wait 2 or 3 seconds and then run the command 'dmesg'  (without the quotes)  

at the bottom of dmesg it should tell you if it recognized the device or not and what name it gave the device.  then you can change your script to that device.


----------



## SirDice (Oct 30, 2009)

gentoobob said:
			
		

> unplug the device, wait 2 or 3 seconds, plug it back in, wait 2 or 3 seconds and then run the command 'dmesg'  (without the quotes)


It's simpler to just `$ tail -f /var/log/messages` and then plug the device in


----------



## gentoobob (Oct 30, 2009)

or that too.  he is a noob he says, so I was making it easier on him.  one word command versus a string command.  thats just how i roll.  haha.


----------



## djemmers (Nov 3, 2009)

tnx guys...

will try that, but am pretty sure it'll work
and gentoobob, yes I am a noob but not such a noob that I can't type a string command


----------



## djemmers (Nov 3, 2009)

*how to mount the new drive?*

ok,
it clearly recognizes the drive:
umass0: Western Digital External HDD, rev 2.00/1.75, addr 3
now when I try to mount it (first line of the backup script)

mount /dev/umass0 /backup   I get:
mount: umass0: No such file or directory
wich seems pretty locical as I can't see umass0 in /dev

how do I mount umass0?
I allready tried
mount umass0 /backup 
and
mount /umass0 /backup.


----------



## Beastie (Nov 3, 2009)

And after "umass0: bla bla on uhubX", doesn't it say something like "da0 at umass bla bla" and then "GEOM_LABEL: Label for provider da0*sX* is *some_filesystem*/*some_label*"?

This should give you all the information you need to mount it.


```
mount /dev/da0[b]sX[/b] /mountpoint
```

For non-UFS formatted drives/partitions, you must specify the filesystem:

```
-t [b]some_filesystem[/b]
```


----------



## dennylin93 (Nov 3, 2009)

Have you partitioned the new drive yet? If not, check out Adding Disks (try not to use sysinstall since fdisk and bsdlabel should work better).


----------



## djemmers (Nov 3, 2009)

beastie:
no that was all the info I got.

dennylin93
aha more ways to format a drive?
that will probably be it.
I guess it is formatted in the "windows way" or something.


----------



## Beastie (Nov 3, 2009)

djemmers said:
			
		

> beastie:
> no that was all the info I got.


Then, it was never formatted, which was the problem all along.


----------



## djemmers (Nov 3, 2009)

allright,

read the info,
But I am a bit affraid to format the new drive on the server. since we don't have a backup at the moment and I am affraid I will format the wrong drive ...

I was thinking, is there a way to format the drive on a windows machine? I know it might sound as a strange question but you never know...


----------



## SirDice (Nov 3, 2009)

Even if the drive isn't formatted you still need to have an /dev/da? available. As long as the fbsd box doesn't recognize it formatting it is useless.


----------



## Beastie (Nov 3, 2009)

As SirDice said, it should at least be detected as daX (e.g. "daX at umass" in dmesg).

As for the rest of your post...
SCSI uses direct access (da) too, just like your *ATA->USB. It should be quite easy to recognize your server HDDs (check `% mount`).

Yes, you could format it under Windows.
However you can't use NTFS because native support in FreeBSD is read-only and using the fuse driver might not be 100% reliable (at least not as reliable as using NTFS under Windows).
You can't use UFS either because third-party UFS support under Windows is suboptimal and may cause BSODs. Not sure you can even format a drive.
You may try FAT32. No comments.


----------



## djemmers (Nov 4, 2009)

SirDice said:
			
		

> you still need to have an /dev/da? available. As long as the fbsd box doesn't recognize it formatting it is useless.



So in my case formatting is useless?
what should I do then?


----------



## dennylin93 (Nov 4, 2009)

Does dmesg detect the drive when you plug it in? If it does, then proceed with the formatting.

As SirDice mentioned, you don't have many options if you want to format with Windows. UFS support on Windows is unthinkable. FAT32 probably isn't good enough. FreeBSD can get full read and write support for NTFS through fusefs-ntfs, but UFS is still better.

Just format the drive on FreeBSD.


----------



## djemmers (Nov 6, 2009)

SirDice said:
			
		

> Even if the drive isn't formatted you still need to have an /dev/da? available.



can't seem to get this right.
to summerize:
command dmesg gives

```
da1: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da1: 34732MB (71132959 512 byte sectors: 255H 63S/T 4427C)
Mounting root from ufs:/dev/da0s1a
WARNING: / was not properly dismounted
WARNING: /home was not properly dismounted
WARNING: /tmp was not properly dismounted
WARNING: /usr was not properly dismounted
/usr: mount pending error: blocks 4 files 1
WARNING: /var was not properly dismounted
umass0: Western Digital External HDD, rev 2.00/1.75, addr 3
umass0: at uhub0 port 1 (addr 3) disconnected
umass0: detached
umass0: Western Digital External HDD, rev 2.00/1.75, addr 3
```
as you see, my Western Digital has no da? 
does that mean there is no da available?

the command mount gave this:

```
/dev/da0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/da1s1e on /home (ufs, local, soft-updates)
/dev/da0s1e on /tmp (ufs, local, soft-updates)
/dev/da0s1f on /usr (ufs, local, soft-updates)
/dev/da0s1d on /var (ufs, local, soft-updates)
```

So I am still trying to find the da? for my WD so I can format it and then mount it...
I just don't seem to get this.


----------



## djemmers (Nov 25, 2009)

No further suggestions?

In the mean time some ppl have allready accidentally deleted some files and because we have no daily backups anymore a lot of info is gone!

so please help me,
how can I find wich DA is my new HD?

greetings


----------



## djemmers (Nov 25, 2009)

demesg gives
umass0: Western Digital External HDD, rev 2.00/1.75, addr 3

does the addr 3 give a hint ?


----------



## djemmers (Nov 25, 2009)

hmm I attached the device got the above demesg message
then I disconnected the usb cable
and got an error message! don't remember what it was
but the server automatically rebooted after that!

This does not sound good in my oppinion!!!

hope you wil help me...


----------



## graudeejs (Nov 25, 2009)

Is there a chance that you are using custom kernel?


----------



## djemmers (Nov 25, 2009)

I guess there is because we know nothing of the server. And the person that installed it is looooong gone

how do I find out ?


----------



## tangram (Nov 25, 2009)

Run `#  fdisk`.

This should output a list of devices along with the filesystems used on their partitions.


----------



## djemmers (Nov 25, 2009)

ok,
I will do that tomorrow,
now I am first making a complete backup from all files and mails through our lan on a HD on my windows pc
that will take a while but that way I am sure I won't loose the data

fingers crossed


----------



## djemmers (Nov 25, 2009)

to make my backup easier
is ther a way to give a command (through putty) to save a certain folder (/home/jan/Maildir) to a place on my HD ?
because I can't browse to the maildirs directly...


----------



## graudeejs (Nov 25, 2009)

show us output of `$ uname -a`


----------



## djemmers (Nov 25, 2009)

uname -a gives:

```
FreeBSD freebsd 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May  8 10:21:06 UTC 2005                                   
[email]root@harlow.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  i386
```


----------



## djemmers (Nov 25, 2009)

fdisk gives


```
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=4427 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=4427 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 69625647 (33996 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 69625710, size 1494045 (729 Meg), flag 0
        beg: cyl 1023/ head 255/ sector 63;
        end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
```


----------



## graudeejs (Nov 25, 2009)

Unfortunately I know nothing about FreeBSD 5


----------



## tangram (Nov 25, 2009)

djemmers said:
			
		

> to make my backup easier
> is ther a way to give a command (through putty) to save a certain folder (/home/jan/Maildir) to a place on my HD ?
> because I can't browse to the maildirs directly...



I use WinSCP. It's available at http://winscp.net/eng/index.php.


----------



## tangram (Nov 25, 2009)

Judging for fdisk's output your system isn't recognizing the USB disk. Can you past the full contents of dmesg after inserting the USB disk?


----------



## djemmers (Nov 26, 2009)

demsg gives


```
da1: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da1: 34732MB (71132959 512 byte sectors: 255H 63S/T 4427C)
Mounting root from ufs:/dev/da0s1a
WARNING: / was not properly dismounted
WARNING: /home was not properly dismounted
WARNING: /tmp was not properly dismounted
WARNING: /usr was not properly dismounted
/usr: mount pending error: blocks 4 files 1
WARNING: /var was not properly dismounted
umass0: Western Digital External HDD, rev 2.00/1.75, addr 3
umass0: at uhub0 port 1 (addr 3) disconnected
umass0: detached
umass0: Western Digital External HDD, rev 2.00/1.75, addr 3
```


----------



## dejamuse (Dec 4, 2009)

USB drives are controlled by the SCSI driver.

Type 'camcontrol /devlist'

This will show the drive most likely as da0.  Then you will need to append the slice, most likely as da0s1.

I have a Western Digital Mybook 1TB USB drive preformatted for Windows and mounted it this way:


```
mount -o large -t msdosfs /dev/da0s1 /mountpoint
```

That showed the MS files preloaded on the new drive.

I then went to format it in sysinstall and disklabel but got an error when trying to write the partition to the drive, something like: "can't write to device da0s1".

So now I'm stuck.  Not sure why I can't write to it, since it was recognized by the disklabel editor.  Some kind of write protect in Mybook or something?  Thought I saw a post somewhere about that.


----------



## graudeejs (Dec 4, 2009)

You can't format mounted filesystem....

Also sysinstall only supports UFS 


NOTE: also MBR by definition is limited and doesn't support 1TB drives... you need gpt, which isn't supported by sysinstall. but you can do everything in fixit mode 

I've told you probably more than you asked [i think]


----------



## easymac (Dec 4, 2009)

I thought 2TB was the limit before you needed GPT.


----------



## graudeejs (Dec 4, 2009)

Oh, you're right.... [just checked wikipedia]


----------



## dejamuse (Dec 5, 2009)

*Oh yeah...*

Doh!

Now working. Used sysinstall and disklabel to format the drive to UFS2.

All is well!


----------



## djemmers (Dec 5, 2009)

*phewww...*

you guys are talking way over my head...

found another drive I plugged in.

```
umass0: Maxtor OneTouch, rev 2.00/2.00, addr 2
umass0: Get Max Lun not supported (STALLED)
da2 at umass-sim0 bus 0 target 0 lun 0
da2:<Maxtor OneTouch 0201> Fixed Direct Access SCSI-0 device
da2: 1.000MB/s transfers
da2: 117246MB
```

So this one is recognized and has about 115 GB free
how to mount this one ?
(pls consider I am a noob.)


----------



## djemmers (Dec 5, 2009)

when I try to mount:

```
mount: /dev/da2s1 on /backup: incorrect super block
```

How do I know what comes after da2 ?


----------



## dejamuse (Dec 6, 2009)

Don't know what that error means.

Why don't you plug the WD back in and just format it for FBSD?

Follow these instructions as I did on my WD 1TB drive.  You'll likely use the whole disk for FBSD and a single slice, as I did.

After formatting it reboot and type 'camcontrol devlist' to see what the device is, eg, da1.  Remember, external USB drives are considered SCSI drives. If you formatted it as a single slice, then mount that slice:

mount /dev/da1s1 /backup


----------



## Beastie (Dec 6, 2009)

&quot said:
			
		

> Oh, you're right.... [just checked wikipedia]


You can easily remember it, logically, without having to check: the MBR uses a 32-bit int/dword to store the BIOS partition size, so the maximum supported is 4GB (2^32) * 512 bytes (the typical size of a sector) = 2048GB = 2TB. Easy.


----------



## Beastie (Dec 6, 2009)

djemmers said:
			
		

> when I try to mount:
> 
> ```
> mount: /dev/da2s1 on /backup: incorrect super block
> ...


You can check the MBR using `% fdisk /dev/da2`.
The slice may be FAT formatted. If it is, try mounting it using the *-t msdosfs* option.


----------

