# linux 새로운 디스크 포맷 및 마운트 방법 #

2TB 이상일 경우 parted
[root@dsmaref ~]# parted /dev/sdc (파티션 구성)

GNU Parted 2.1

Using /dev/sdc

Welcome to GNU Parted! Type ‘help’ to view a list of commands.

(parted)                                                               

Error: /dev/sdc: unrecognised disk label                                 

(parted) mklabel

New disk label type? gpt                                                  

(parted) mkpart                                                          

Partition name?  []?                                                     

File system type?  [ext2]? ext4                                           

Start? 0                                                                  

End? -1                                                                  

Warning: The resulting partition is not properly aligned for best performance.

Ignore/Cancel? Ignore                                                    

(parted) p                                                               

Model: DELL PERC H730 Mini (scsi)

Disk /dev/sdc: 4000GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

 

Number  Start   End     Size    File system  Name  Flags

1      17.4kB  4000GB  4000GB

 

(parted) q                                                                

Information: You may need to update /etc/fstab.                          

 

[root@dsmaref ~]# lsblk (sdc1 이 보이는 지 확인)

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT

sdb      8:16   0  10.9T  0 disk

└─sdb1   8:17   0  10.9T  0 part /data

sda      8:0    0 278.9G  0 disk

├─sda1   8:1    0   200M  0 part /boot

├─sda2   8:2    0    64G  0 part [SWAP]

└─sda3   8:3    0 214.7G  0 part /

sdc      8:32   0   3.7T  0 disk

└─sdc1   8:33   0   3.7T  0 part

sr0     11:0    1  1024M  0 rom  
 

[root@dsmaref ~]# lsblk  -f (sdc1 이 보이는 지 확인)

NAME   FSTYPE LABEL UUID                                 MOUNTPOINT

sdb                                                      

└─sdb1 ext4         2d3e8015-0704-48f1-9bd6-6124a17c3a53 /data

sda                                                     

├─sda1 ext4         000f715a-e4af-4a0a-9371-0f2fb51550ef /boot

├─sda2 swap         54f61ddb-9bb6-47a8-a3e9-4839c9ac1300 [SWAP]

└─sda3 ext4         b5755e1d-8cc8-471d-a5a4-a21cfe24afde /

sdc                                                     

└─sdc1 
                                                 

sr0                                                      

[root@dsmaref ~]# mkfs.ext4 /dev/sdc1 (파티션 ext4 파일시스템으로 포맷)

mke2fs 1.41.12 (17-May-2010)

Filesystem label=                                          

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

244154368 inodes, 976617223 blocks

48830861 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

29804 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

        102400000, 214990848, 512000000, 550731776, 644972544

 

Writing inode tables: done                           

Creating journal (32768 blocks): 엔터

done

Writing superblocks and filesystem accounting information: 엔터

done

This filesystem will be automatically checked every 23 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@dsmaref ~]# tune2fs -c -1 -i 0 /dev/sdc1 (파일시스템 강제 체크하는 마운트 횟수 및 기간 설정 변경)

tune2fs 1.41.12 (17-May-2010)

Setting maximal mount count to -1

Setting interval between checks to 0 seconds

 

[root@dsmaref ~]# mkdir -p /data2

[root@dsmaref ~]# blkid (sdc1의 유니크한 ID(UUID) 확인)

/dev/sda3: UUID=”b5755e1d-8cc8-471d-a5a4-a21cfe24afde” TYPE=”ext4″

/dev/sdb1: UUID=”2d3e8015-0704-48f1-9bd6-6124a17c3a53″ TYPE=”ext4″

/dev/sda1: UUID=”000f715a-e4af-4a0a-9371-0f2fb51550ef” TYPE=”ext4″

/dev/sda2: UUID=”54f61ddb-9bb6-47a8-a3e9-4839c9ac1300″ TYPE=”swap”

/dev/sdc1: UUID=”5acda3c5-830a-4141-b274-377b9542a73f” TYPE=”ext4″

 

 

[root@dsmaref ~]# vi /etc/fstab (fstab에 마운트 추가)

 

  9 UUID=b5755e1d-8cc8-471d-a5a4-a21cfe24afde /                   ext4    defaults        1 1

10 UUID=000f715a-e4af-4a0a-9371-0f2fb51550ef /boot                ext4    defaults        1 2

11 UUID=2d3e8015-0704-48f1-9bd6-6124a17c3a53 /data              ext4    defaults        1 2

12 UUID=54f61ddb-9bb6-47a8-a3e9-4839c9ac1300 swap             swap    defaults        0 0

13 UUID=5acda3c5-830a-4141-b274-377b9542a73f /data2         ext4     defaults  0 0 (추가)

14 tmpfs                   /dev/shm                tmpfs   defaults        0 0

15 devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

16 sysfs                   /sys                    sysfs   defaults        0 0

17 proc                    /proc                   proc    defaults        0 0

 

[root@dsmaref ~]# mount -a (자동마운트로 붙는지 확인)

[root@dsmaref ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3       212G   51G  151G  26% /

tmpfs            16G   80K   16G   1% /dev/shm

/dev/sda1       190M   38M  142M  22% /boot

/dev/sdb1        11T  2.2T  8.1T  21% /data

/dev/sdc1       3.6T   68M  3.4T   1% /data2

Leave a Comment