我想知道我是否可以回收所有存储空间。我不需要恢复数据,我可以随心所欲地进行攻击。
情况:两个控制器,每个控制器有八个磁盘,两个 RAID 集(RAID6)。一个 RAID 集被移交给操作系统,显示 2.2TB,另一组显示 12TB。
我使用它进行了深度扫描testdisk
,它返回了几十个“不可恢复的分区”,但我找不到一种方法来告诉testdisk
我删除这些分区并给我所有的空间。
testdisk
回来了:(The harddisk (2199 GB / 2048 GiB) seems too small! (< 29 TB / 26 TiB) Check the harddisk size: HD jumpers settings, BIOS detection...
也许有是跳线或设置在某处?)
是不可恢复的分区阻止操作系统“看到”12TB 的完整大小?我怎样才能删除不可恢复的分区并收回我所有的磁盘空间?
Adaptec 控制器
除了以下无意义的差异外,它们都是运行 1.2.0.30300 的 Adaptec 5805 控制器:
root@system:~# arcconf getconfig 2 AD > /tmp/adapter2.info
root@system:~# arcconf getconfig 1 AD > /tmp/adapter1.info
root@system:~# diff /tmp/adapter1.info /tmp/adapter2.info
8,10c8,10
< Controller Serial Number : xxxxxxxxxxx
< Physical Slot : 3
< Temperature : 77 C/ 170 F (Normal)
> Controller Serial Number : yyyyyyyyyyy
> Physical Slot : 4
> Temperature : 76 C/ 168 F (Normal)
RAID组
根据 RAID 控制器的管理工具,RAID 集正如我所期望的那样arcconf
:
root@system:~# arcconf getconfig 1 ld
Controllers found: 2
----------------------------------------------------------------------
Logical device information
----------------------------------------------------------------------
Logical device number 0
Logical device name : STORAGE1
RAID level : 6 Reed-Solomon
Status of logical device : Optimal
Size : 11427830 MB
Stripe-unit size : 256 KB
<...snip...>
root@system:~# arcconf getconfig 2 ld | more
Controllers found: 2
----------------------------------------------------------------------
Logical device information
----------------------------------------------------------------------
Logical device number 0
Logical device name : STORAGE2
RAID level : 6 Reed-Solomon
Status of logical device : Optimal
Size : 11427830 MB
Stripe-unit size : 256 KB
<...snip...>
操作系统程序
lsscsi
输出:
root@system:~# lsscsi -s | grep Adaptec
[0:0:0:0] disk Adaptec STORAGE1 V1.0 /dev/sdc 2.19TB
[7:0:0:0] disk Adaptec STORAGE2 V1.0 /dev/sdd 11.9TB
testdisk
报告:
Disk /dev/sdc - 2199 GB / 2048 GiB - CHS 267349 255 63
Disk /dev/sdd - 11 TB / 10 TiB - Adaptec STORAGE2
扫描后,testdisk
显示几个分区:
The following partitions can't be recovered:
Partition Start End Size in sectors
> MS Data 52734 19503545853 19503493120
MS Data 52736 19503545855 19503493120
MS Data 262654 19503755773 19503493120
MS Data 262656 19503755775 19503493120
MS Data 367102 19503860221 19503493120
MS Data 367104 19503860223 19503493120
MS Data 1311742 19504804861 19503493120
MS Data 1311744 19504804863 19503493120
MS Data 1312254 19504805373 19503493120
MS Data 1312256 19504805375 19503493120
<...snip...>
lsblk
也只显示 2TB:
root@system:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdc 8:32 1 2T 0 disk
sdd 8:48 1 10.9T 0 disk
其他事情
我试过了:
1.) 用于dd
将全零写入整个磁盘,但仅写入 2.2TB,直到停止并显示消息“设备上没有剩余空间”。同样,仅写入 2.2TB 空间。
root@system:~# dd if=/dev/zero of=/dev/sdc bs=8M
dd: error writing ‘/dev/sdc’: No space left on device
262145+0 records in
262144+0 records out
2199023255552 bytes (2.2 TB) copied, 2870.71 s, 766 MB/s
root@system:~# fdisk -l /dev/sdc
Disk /dev/sdc: 2 TiB, 2199023255552 bytes, 4294967296 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
2.) 用于parted
删除所有分区,只为操作系统提供一个未分区的驱动器。
root@system:~# parted /dev/sdc
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: /dev/sdc: unrecognised disk label
Model: Adaptec STORAGE1 (scsi)
Disk /dev/sdc: 2199GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
3.) 我尝试重建 RAID 集、删除并重新创建 RAID 集,并使用 smartctl 扫描所有磁盘。不用找了。
4.)gpart /dev/sdc
返回一些内容,但并不建议我对此做太多事情(只是返回到我的提示符,不停留在 gpart 交互模式)。
root@system:~# gpart /dev/sdc
Begin scan...
End scan.
Checking partitions...
Ok.
Guessed primary partition table:
Primary partition(1)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
Primary partition(2)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
Primary partition(3)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
Primary partition(4)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
答案1
好吧,执行以下操作后:
arcconf delete 1 logicaldrive all
arcconf tast start 1 device all intialize
arcconf CREATE 1 LOGICALDRIVE Name STORAGE1 blah..blah...
我现在得到了我所期望的:
root@system:~# lsscsi -s | grep Adaptec
[0:0:0:0] disk Adaptec STORAGE1 V1.0 /dev/sda 11.9TB
[7:0:0:0] disk Adaptec STORAGE2 V1.0 /dev/sdc 11.9TB
问题解决了。硬件看起来不错。