질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

[질문]리눅스 데이터를 백업 해야 하는데 초보라서..

작성자 정보

  • 손용희 작성
  • 작성일

컨텐츠 정보

본문

운영자님의 경고(?)에 리플 답니다. ^^;

일단 서버에 백업할 하드를 장착하시구요, 장착된 하드가 파티션이 분할되어 있으면 문제 없구요, 새 하드라면 파티션 생성해 주시구여, 파일 포맷 해주셔야 합니다.

1. 새로운 HDD를 장착한다.

2. 재부팅후 "dmesg | grep ide" SCSI일경우 'SCSI'로 'ide'를 대신한다.
$ dmesg | grep ide
BIOS-provided physical RAM map:
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:DMA
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: attached ide-disk driver.
hdb: attached ide-disk driver.
ide: late registration of driver.


3. 추가 디스크의 ID 'hdb'를 확인한다.

4. 파티션을 생성해준다.
$ fdisk /dev/hdb
Command (m for help):
Command (m for help): n
Partition number (1~8): 1
※ 참고 : fdisk 명령어
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

5. 새 파티션에 파일 시스템을 생성한다. (format)
$ mkfs.ext3 /dev/hdb (ext2타입으로 할 경우에는 mkfs.ext2 명령 사용)

6. 새 파티션을 마운트 시키기 위한 디렉토리 생성후 마운트 한다.
$ mkdir /backup
$ mount -t ext3 /dev/hdb /backup

7. 파일시스템 확인
$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 19006892 6112256 11929132 34% /
/dev/hda1 101086 6349 89518 7% /boot
none 257280 0 257280 0% /dev/shm
/dev/hdb 32509368 32828 30825160 1% /backup

/backup 디렉토리에 장착한 하드가 마운트 됐으면 백업할 파일을 backup 디렉토리에 복사해 주시면 됩니다.
백업이 끝나면 umount /mnt/hdb 하셔서 마운트를 해제하시면 됩니다.

만약 장착된 하드가 기존에 ext계열로 파티션이 분활 되어 있다면
mount -t ext3 /dev/hdb1 /backup으로 해주시면 됩니다.
/dev/hdb 뒤에 파티션 번호를 반드시 적어주셔야 합니다.

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,042 명
  • 현재 강좌수 :  35,846 개
  • 현재 접속자 :  124 명