How to mount hardisk in freebsd
this tutorial will cover on how to mount new hardisk into your current server.
mount using fstab
fstab is configuration files where the system save the mount settings. as per default, usually user will be promt at installation of OS where to mount your partition. root partition and swap usually are automaticaly setup.
where is fstab located?
/etc/fstab
how to edit?
using your favourite text editor. nano, vi, ee
sudo vi /etc/fstab
Device - the device detected, u can use dmesg to detect the devices.
Mountpoint - location where u planed to mount the new storage.
FStype - type of file system. eg: ufs, nfs, swap. fat32, ext4
Option - Option to mount. please refer to the manual as there is many option for mouting. rw is for read and write
FIRST PART
cat /proc/partitions | grep sd
#fdisk -l
#fdisk /dev/sdb
press n
press p (for Primary)
keep default value
keep default value (if we want to use entire disk)
press p (to verify created partition
press w (to write changes)
#partprobe /dev/sdb (to make Kernel reread the partition table)
SECOND PART
#mkdir /data
#chmod -R 777 /data (make it available to all users)
#mkfs.ext3 /dev/sdb1 (format the new drive)
>>>> optional for freebsd: #newfs </dev/da1s>
#mount /dev/sdb1 /data
#nano /etc/fstab
add /dev/sdb1 /data ext3 defaults 0 0
#mount -a
#df -h
DONE
-------refer 172.17.250.76
How to change the hardisk parth > edit in vi /etc/fstab
mount -t cifs //ipaddress/backup -o username=admin,password=admin /mountpath
fstab option
//ipaddress/backup /datadomain cifs username=admin,password=admin,iocharset=utf8,sec=ntlm 0 0 >>>>>>>>>>add kat /etc/fstab
how to unmount
simple ways.
umount /mountpath
or
delete the entry added before in fstab and restart.
or mount -a (this one automaticaly unmount partition that is not main partition)
if u have any suggestion or comment, please add comment below.
simple ways.
umount /mountpath
or
delete the entry added before in fstab and restart.
or mount -a (this one automaticaly unmount partition that is not main partition)
if u have any suggestion or comment, please add comment below.
Comments
Post a Comment