[Xubuntu]Xubuntu 외장하드 포맷하고 마운트하기/Format and mount an external hard drive in Xubuntu

👉🏻 xubuntu에서 외장하드를 usb로 연결하면 일반적으로 자동마운트가 됩니다.
When you connect an external hard drive via USB in Xubuntu, it usually mounts automatically.

👉🏻 하지만 마운트하고 나면 마운트된 디렉토리 이름이 이상하게 표시되는 경우가 있습니다.
However, after mounting, the mounted directory name may appear strange.

👉🏻 여러분이 원하는 이름으로 사용하길 원하면 다음과 같이 하시면 됩니다.
If you want to use the name you want, you can do it like this:

👉🏻 리눅스로 한번 포맷한 하드디스크는 윈도우등에서 인식되지 않을 수 있습니다.
A hard disk that has been formatted once with Linux may not be recognized by Windows, etc.

👉🏻 그래서 외장하드를 다른 운영체제에서도 인식될 수 있게 하려면 NTFS포맷하시면됩니다.
So, if you want your external hard drive to be recognized by other operating systems, you can format it to NTFS.

1.포맷/Format

✔️ 마운트 상태 확인 / Check mount status

먼저 터미널에서 현재 디스크 상태를 확인합니다.
First, check the current disk status in the terminal.

아래는 외장하드가 sdb1인 경우로 하겠습니다.
Below, we will assume that the external hard drive is sdb1.

lsblk

✔️ 마운트 설정되어있으면 모두 마운트 해제 합니다.
If mounts are set, unmount them all.

sudo umount /dev/sdb1
# 또는 / or
sudo umount /media/yourhomedirectory/mounted directory name

✔️ 하드디스크 초기화 및 NTFS포맷
Hard disk initialization and NTFS format

— 기존 파티션을 삭제하고 윈도우에서 인식 가능한 NTFS로 포맷하는 과정입니다.
The process of deleting the existing partition and formatting it to NTFS, which can be recognized by Windows.

1)파티션 테이블 생성 (GPT)
Create a partition table (GPT)

sudo parted /dev/sdb mklabel gpt

2)파티션 생성 (디스크 전체 사용)
Create a partition (use the entire disk)

⭐️ 가끔 운영체제등이 설치되어있는경우 파티션이 분할되어 있는 경우가 있습니다.
Sometimes, when an operating system is installed, the partition may be divided.

sudo parted /dev/sdb mkpart primary ntfs 0% 100%

3)NTFS 파일 시스템 포맷
NTFS file system format

sudo mkfs.ntfs -f /dev/sdb1

2.하드디스크 마운트 / hard disk mount

✔️ 마운트할 디렉토리를 생성하고 포맷한 하드디스크를 마운트합니다.
Create a directory to mount and mount the formatted hard disk.

⭐️ xubuntu에서 외장하드가 자동 마운트 되는 기본 위치는/media/your home directory/ 입니다.
The default location where external hard drives are automatically mounted in Xubuntu is /media/your home directory/

✔️ 완료 후 df -h 명령어로 연결이 잘 되었는지 확인합니다.
After completion, check if the connection is successful using the df -h command.

sudo mkdir -p /media/yourhomedirectory/ssd1tb
sudo mount /dev/sdb1 /media/yourhomedirectory/ssd1tb

3. 부팅시 자동마운트 설정하기(fstab)
Setting up automatic mounting at boot (fstab)

✔️ 외장 하드 디스크 UUID 확인 하기
Checking the UUID of an external hard disk

✔️ UUID=”자신의_UUID” 부분을 복사합니다.
Copy the UUID=”your_UUID” part.

sudo blkid /dev/sdb1

✔️ /etc/fstab 파일 수정
Edit the /etc/fstab file

sudo nano /etc/fstab

파일 맨 하단에 다음 형식으로 추가 합니다.
Add the following format to the very bottom of the file:

파일 내용이 수정되었으면 저장하고 편집기에서 나옵니다.
Once the file contents have been modified, save them and exit the editor.

# sdb1 (SSD 1TB)
UUID=687CA4B151B904D5  /media/yourhomedirectory/ssd1tb  ntfs  defaults,uid=1000,gid=1000,umask=000,nofail  0  0

✔️ 시스템 반영 및 데몬 재시작
System reflection and daemon restart

sudo systemctl daemon-reload
sudo mount -a

mount -a 실행 시 아무 에러가 없으면 성공입니다!
If there are no errors when running mount -a, it is a success!

Leave a Reply