HDD add in Linux(fstab)

 1. 현재 파티션 확인하기

/sbin/fdisk -l


2. 파티션 추가하기 

/sbin/fdisk /dev/sdb


in fdisk 

command : n ; add a new partition 


in command n 

enter ; partition type is primary 

enter ; partition number is 1

enter ; first sector is 2048

enter ; last sector is default


command : p ; print the partition table ; 파티션 확인하기 

; /dev/hdb1


command : w ; 파티션 저장하기


3. 포맷하기 

mkfs -t ext4 /dev/sdb1


4. mount 

mkdir /data


; uuid 확인후 fstab 에 넣어준다.

ls -l /dev/disk/by-uuid   

; uuid is 75302ae8-acd4-456b-a12b-dcc0764db6ab


vim /etc/fstab


; 추가 in debian 

UUID=f4f38019-263c-4a63-88d6-0434c537ad9c /data           ext4    errors=remount-ro 0       1

; 추가 in centos

UUID=75302ae8-acd4-456b-a12b-dcc0764db6ab /data                   ext4    defaults        0 0


댓글

이 블로그의 인기 게시물

react step