티스토리 뷰

OS/Linux

Ubuntu 디스크 mount 하기

파란크리스마스 2017. 4. 19. 14:03
728x90

Ubuntu 디스크 mount 하기

출처 : Mint & Latte_. :: 리눅스에서 하드디스크 mount 하기

추가된 디스트 Volume 확인

$ sudo fdisk -l
 
Disk /dev/vda: 42.9 GB, 42949672960 bytes
16 heads, 63 sectors/track, 83220 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000648d6
 
   Device Boot      Start         End      Blocks   Id  System
/dev/vda1            2048     3905535     1951744   82  Linux swap / Solaris
/dev/vda2   *     3905536    83885759    39990112   83  Linux
 
Disk /dev/vdb: 214.7 GB, 214748364800 bytes
16 heads, 63 sectors/track, 416101 cylinders, total 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/vdb doesn't contain a valid partition table

파일시스템 생성

$ sudo mkfs.ext4 /dev/vdb
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
13107200 inodes, 52428800 blocks
2621440 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1600 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
 
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

mount 받을 디렉토리 생성

$ sudo mkdir /bluexmas_db

mount 하기

$ sudo mount /dev/vdb /bluexmas_db

mount 확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G   12K  2.0G   1% /dev
tmpfs           396M  364K  395M   1% /run
/dev/vda2        38G  1.6G   35G   5% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            2.0G     0  2.0G   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/vdb        197G   60M  187G   1% /bluexmas_db

unmount 하기

$ sudo umount /bluexmas_db

unmount 확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G   12K  2.0G   1% /dev
tmpfs           396M  372K  395M   1% /run
/dev/vda2        38G  9.2G   27G  26% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            2.0G     0  2.0G   0% /run/shm
none            100M     0  100M   0% /run/user

자동 mount

출처 : Ubuntu 14.04에 새로운 하드디스크 추가 및 포맷후 자동 마운트 설정

UUID 확인

$ sudo blkid
/dev/vda1: UUID="4874a47d-f878-440c-95d0-297e6733abea" TYPE="swap" 
/dev/vda2: UUID="20c996fb-8c20-4e7f-958e-84b7581af70f" TYPE="ext4" 
/dev/vdb: UUID="6e0b7ac6-d17d-4829-839f-80662339cf6b" TYPE="ext4" 

fstab 파일에 파티션 추가

$ sudo vi /etc/fstab

# 파티션 추가
UUID=6e0b7ac6-d17d-4829-839f-80662339cf6b	/bluesanta	ext4	defaults	0	0
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함