Thursday, May 8, 2008

Mounting

Well It seems I've over looked the simple things I don't think twice about such as mounting usb device and hard drives. A good thing about FreeBSD 7 is it has built in support for FAT and NTFS right out of the box you don't need to compile your own kernel. Lets start with something simple an USB flash drive. If you use them for school or work they are probably going to be formated with FAT file system. So when you plug it into your computer and do a dmesg you will get some out put like this.
da0 at umass-sim0 bus 0 target 0 lun 0da0: Removable Direct Access SCSI-0 deviceda0: 40.000MB/s transfersda0: 3935MB (8058880 512 byte sectors: 255H 63S/T 501C)
You can mount it anywhere you wan't I choose to do it neatley and make a usb directory in mnt folder
#mkdir /mnt/usb
Now to mount it
#mount -t msdos /dev/da0s1 /mnt/usb
Now the device is mounted in /mnt/use and you can browse to that folder and see the contents.

It's pretty similar for ntfs drive. Here is the output for my ntfs drive.
da1 at umass-sim1 bus 1 target 0 lun 0da1: Fixed Direct Access SCSI-4 deviceda1: 40.000MB/s transfersda1: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)
Make the directory where you want to mount it.
#mkdir /mnt/500
Now we mount it
#mount -t ntfs /dev/da1s1 /mnt/500
Relativley simple

Mounting an IDE or SATA is a little harder but still easy. Ok so lets say you installed a hard drive Im going to use NTFS for example here. dmesg is going to show it but good luck finding it on the list, since it's detected at boot. So the easier way is to view the dev directory.
#cd /dev
#ls
(Im going to trunkate the output to sata drives)
ad14
ad14s1
ad14s1a
ad14s1b
ad14s1c
ad14s1d
ad14s1e
ad14s1f
ad15
ad15s1
From this list we see the ad14 drive had 7 partitions, we can assume this is a unix partition (unless you are partition happy on all your drives) A diffrent partition is made for /, /sys, /home etc...
ad15 has one partition so its safe to assume this is the NTFS drive (unless you make funky partitions which in that case I would assume you would know which drive is yours lol)
Once again make the dir where you want to mount it.
#mkdir /mnt/drive
And mount it
#mount -t ntfs /dev/ad15s1 /mnt/drive
Now you are free to browse you drives.
If you want to know how to mount cd and iso please look at the source tree post they are both covered in there.

No comments: