상세 컨텐츠

본문 제목

Linux(Ubuntu) 에서 외장 SSD 포맷, 마운트 하기

Dev.Stroy/Linux

by zNine 2021. 11. 24. 11:26

본문

728x90
반응형

윈도우 파일 백업용으로 사용하던 삼성 T7 SSD를 우분투 서버에서 쓰기 위해,

ext4 file system 으로 포맷 후 마운트 하기 까지의 내용을 담아본다.

서버에 USB로 연결 후 확인

# fdisk -l

Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: PSSD T7
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x2b01b7a3

Device     Boot Start        End    Sectors   Size Id Type
/dev/sda1        2048 1953522112 1953520065 931.5G  7 HPFS/NTFS/exFAT

파티셔닝

# parted /dev/sda
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) print
Model: Samsung PSSD T7 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags

(parted) unit TB
(parted) mkpart data1 0 100%
(parted) print
Model: Samsung PSSD T7 (scsi)
Disk /dev/sda: 1.00TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name   Flags
 1      0.00TB  1.00TB  1.00TB               data1

(parted) quit
Information: You may need to update /etc/fstab.

포맷

# mkfs.ext4 /dev/sda1
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 244175218 4k blocks and 61046784 inodes
Filesystem UUID: 1f0130ae-ce70-4511-b484-fd01d0851dec
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

UUID 확인

# blkid | grep sda1
/dev/sda1: UUID="1f0130ae-ce70-4511-b484-fd01d0851dec" TYPE="ext4" PARTLABEL="data1" PARTUUID="811d6854-ddb4-4539-806d-3107ed105c2e"

마운트

# mount /dev/sda1 /data

부팅 시 자동 마운트 되도록 설정

UUID 복사 후 /etc/fstab 수정

# vi /etc/fstab

아래 내용 추가
UUID=1f0130ae-ce70-4511-b484-fd01d0851dec     /data    ext4    defaults    0    0

 

728x90
반응형

관련글 더보기