Thứ Ba, 14 tháng 11, 2017

Add new DISK Centos

Rescan scsi bus
find your host bus number
grep mpt /sys/class/scsi_host/host?/proc_name
Which should return a line like
/sys/class/scsi_host/host0/proc_name:mptspi
where host0 is the relevant field.
use this to rescan the bus with the following command
echo "- - -" > /sys/class/scsi_host/host0/scan
Check Hard Drives
# lsblk


Create Partition

#fdisk /dev/sdb

Format ext4

mkfs.ext4 /dev/sdb1

Mount
mkdir /data
mount /dev/sdb1 /data
ls /dev/disk/by-uuid/ -l

echo "UUID=beaf6dd0-c5ff-4038-9ce1-be29431c7899    /data/    ext4    defaults    0    0" >> /etc/fstab
 How to check the entries in fstab without system reboot

/etc/fstab contains information about the disks. It has the details about where the partitions and storage devices should be mounted. We usually configure automount, disk quota, mount points etc in this fstab.
Inorder to test the entries or modifications in fstab without restart the following commands will be helpful
mount -a
The above command will mount all the filesystems mentioned in the fstab. This is just like a refresh command to activate the entries in fstab.
mount -fav
The above command will help if you don’t want to apply the modifications in the fstab and want to validate the entries only.  This will just fake the entries in the fstab without applying the changes. This is a very useful command.

Share This!


Không có nhận xét nào:

Đăng nhận xét