기존 800G 디스크를 사용하고 있는 DB 서버에서

DB를 백업해야하는 상황이다.


xtrabackup을 사용하려는데

남아있는 디스크가 얼마 되지 않아서

백업을 위한 텅빈 디스크가 필요하다.


http://sfixer.tistory.com/entry/%EB%94%94%EC%8A%A4%ED%81%AC-%EB%B3%BC%EB%A5%A8-%EC%82%AC%EC%9D%B4%EC%A6%88-%EC%A6%9D%EA%B0%80%EC%8B%9C%ED%82%A4%EA%B8%B0

이전에 작성했던 나의 포스트를 참고해서 시작했다.


마우스로 EC2로 가서

Elastic Bloack Store의 Volume을 클릭하고

클릭클릭... 500G 만들거니까 클릭클릭..

원하는 인스턴스에 Attach까지 


음.. 간단하군

이제 실제로 붙여 볼까.

아, 역시 그냥 하면 당연히 안되지 😭


[ec2-user@ip-sfixer ~]$ lsblk                                                  

NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT                                    

xvda    202:0    0  800G  0 disk                                               

└─xvda1 202:1    0  800G  0 part /                                             

xvdf    202:80   0  500G  0 disk                                               

[ec2-user@ip-sfixer ~]$ sudo mount /dev/xvdf /Storage                          

mount: mount point /Storage does not exist                                     

                                               

 

왠지 마운트 하기전에 디스크 타입을 맞춰야 할듯하다.


https://docs.aws.amazon.com/ko_kr/AWSEC2/latest/UserGuide/ebs-using-volumes.html

 

참고해보니 있다. 아래의 순서로 명령을 수행한다.


 

[ec2-user@ip-sfixer ~]$ lsblk                                                     

NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT                                       

xvda    202:0    0  800G  0 disk                                                  

└─xvda1 202:1    0  800G  0 part /                                                

xvdf    202:80   0  500G  0 disk                                                  

                                                                               

[ec2-user@ip-sfixer ~]$ sudo file -s /dev/xvdf                                    

/dev/xvdf: data                                                                   

[ec2-user@ip-sfixer ~]$ sudo file -s /dev/xvda1                                   

/dev/xvda1: Linux rev 1.0 ext4 filesystem data, UUID=fa5b665e-c3ee-4596-ac88-ae39494c7bf2 (needs journal recovery) (extents) (large files) (huge files)

                                                                               

[ec2-user@ip-sfixer ~]$ sudo mkfs -t ext4 /dev/xvdf                               

mke2fs 1.42.12 (29-Aug-2014)                                                      

Creating filesystem with 131072000 4k blocks and 32768000 inodes                  

Filesystem UUID: c73a1534-0bd3-4c52-9ec5-25b6f0d3945e                             

Superblock backups stored on blocks:                                              

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

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

        102400000                                                                 

                                                                                  

Allocating group tables: done                                                     

Writing inode tables: done                                                        

Creating journal (32768 blocks): done                                             

Writing superblocks and filesystem accounting information: done                   

                                                                                  

[ec2-user@ip-sfixer ~]$ sudo file -s /dev/xvdf                                    

/dev/xvdf: Linux rev 1.0 ext4 filesystem data, UUID=c73a1534-0bd3-4c52-9ec5-25b6f0d3945e (extents) (large files) (huge files)

                                                                               

[ec2-user@ip-sfixer ~]$ sudo mkdir /Storage                                       

[ec2-user@ip-sfixer ~]$ sudo mount /dev/xvdf /Storage/                         

[ec2-user@ip-sfixer ~]$ cd /Storage/                                           

[ec2-user@ip-sfixer Storage]$ ll



제대로 되었다. 완료


+ Recent posts