
언젠가 Debian X64 서버에 RAID0을 구성했는데 지금까지는 문제 없이 잘 작동하고 있습니다. 어느 날 방금 확인해 df -h
보니 디스크 공간의 62%가 이미 사용된 것으로 나타났습니다.
RAID는 2TB 드라이브 2개로 구성되어 현재는 20GB만 사용하고 있는데 출력을 보니 34G면 크기라고 나오네요. 설정에 문제가 있나요?
df -H 출력 :
df -H
Filesystem Size Used Avail Use% Mounted on
rootfs 456G 7,3G 425G 2% /
udev 11M 0 11M 0% /dev
tmpfs 3,4G 300k 3,4G 1% /run
/dev/disk/by-uuid/ae73679c-c3cd-4a60-bcbb-5b6ddce867f7 456G 7,3G 425G 2% /
tmpfs 5,3M 0 5,3M 0% /run/lock
tmpfs 11G 4,1k 11G 1% /run/shm
/dev/sdc2 529M 41M 461M 9% /boot
// This last one
/dev/md1 34G 20G 13G 62% /media/attachment
mdadm --detail /dev/md1 출력:
/dev/md1:
Version : 1.2
Creation Time : Wed Apr 29 11:12:21 2015
Raid Level : raid0
Array Size : 33553408 (32.00 GiB 34.36 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Wed Apr 29 11:12:21 2015
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Chunk Size : 512K
Name : legion03:1 (local to host legion03)
UUID : 68e853a6:7af46176:d9c147c7:6ff87bb0
Events : 0
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
출력
fdisk -l | grep Disk
fdisk -l | grep Disk
Disk /dev/md1 doesn't contain a valid partition table
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Disk identifier: 0x00089ca4
Disk /dev/sdc: 480.1 GB, 480103981056 bytes
Disk identifier: 0x00047ef7
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
Disk identifier: 0x000275d2
Disk /dev/md1: 34.4 GB, 34358689792 bytes
Disk identifier: 0x00000000
RAID0 설정에 문제가 있습니까? 어떤 도움이라도 좋을 것입니다. 감사합니다.
업데이트
fdisk -l의 출력:
fdisk -l
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 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: 0x00089ca4
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907029167 1953513560 fd Linux raid autodetect
Disk /dev/sdc: 480.1 GB, 480103981056 bytes
255 heads, 63 sectors/track, 58369 cylinders, total 937703088 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: 0x00047ef7
Device Boot Start End Blocks Id System
/dev/sdc1 2048 33556480 16777216+ 82 Linux swap / Solaris
/dev/sdc2 33558528 34607104 524288+ 83 Linux
/dev/sdc3 34609152 937701040 451545944+ 83 Linux
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 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: 0x000275d2
Device Boot Start End Blocks Id System
/dev/sda1 2048 3907029167 1953513560 fd Linux raid autodetect
Disk /dev/md1: 34.4 GB, 34358689792 bytes
2 heads, 4 sectors/track, 8388352 cylinders, total 67106816 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disk identifier: 0x00000000
Disk /dev/md1 doesn't contain a valid partition table
답변1
귀하는 /dev/md1
각각 크기가 16GiB인 두 개의 파티션이 결합된 것으로 보입니다(또는 최대 32GiB까지 추가할 수 있는 다른 크기). 나중에 추가된 결과는 fdisk -l
그와 모순됩니다. 완전한 기록이 없으면 현재 상태의 원인이 무엇인지 추측할 수 있지만 /dev/md1
한 가지 가능성은 RAID 장치가 생성된 후 파티션 테이블이 변경되었다는 것입니다(해당 일련의 이벤트가 이 상태로 이어질 수 있는지 여부는 테스트하지 않았습니다).
두 디스크의 파티션 테이블만 보고하려면 다음과 같은 명령을 사용하세요.
fdisk -l /dev/sd[ab]
해당 파티션에 20G의 데이터를 유지하려면 /dev/md1
.
현재 파티션 테이블은 /dev/sda
해당 /dev/sdb
디스크의 RAID 파티션에 적합합니다. 해당 디스크를 분할하는 방법(및 분할 여부)에 대한 이전 논평을 편집했습니다.
해체하고 다시 만들려면 /dev/md1
다음 명령 시퀀스를 사용할 수 있습니다.
mdadm --stop /dev/md1
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd[ab]1
나는 첫 번째 명령이 비파괴적이라고 생각하지만 /dev/md1
두 번째 명령을 실행하기 전에(그리고 실제로는 첫 번째 명령을 실행하기 전에) 기존 데이터를 백업하는 것이 좋습니다. 첫 번째 명령의 효과를 되돌릴 수 있을 것이라고 생각 mdadm --assemble
하지만 데이터가 백업되면 그럴 필요가 없습니다.
나는 이 명령 시퀀스를 테스트하지 않았지만(최근은 아니지만) 내 기억과 문서를 읽은 것과 일치합니다. 장치 이름을 올바르게 입력하도록 주의하십시오. mdadm --create
RAID 미러를 생성할 때 두 구성 요소 디스크의 전체 파티션 크기를 사용하는지 여부를 알아내는 것은 흥미로울 것입니다 . 귀하의 의견은 RAID 미러를 원한다는 것을 나타냅니다. --level
다른 것을 원할 경우 매개변수 값이 달라집니다.
또한 내용을 확인 /etc/mdadm.conf
하거나 /etc/mdadm/mdadm.conf
원하지 않는 기본값을 지정하지 않았는지 확인할 수도 있습니다.