从USB机箱移到内部时,无法安装SATA驱动器

我有4个外部驱动器通过USB连接到我的Dell Precision 490工作站。

他们在/ etc / fstab由uuid和格式为UUID。

UUID=04c37bff-b93e-440e-acd0-3d984ddb2ec3 /mnt/drive0 ext4 defaults,nobootwait 0 2 UUID=210765f4-30e5-4863-a40b-aa1fffefe5ca /mnt/drive1 ext4 defaults,nobootwait 0 2 UUID=b981c5e7-249e-4430-9887-96ca674e0733 /mnt/drive2 ext4 defaults,nobootwait 0 2 UUID=22c8a274-3cf9-403f-9558-feb531e407c7 /mnt/drive3 ext4 defaults,nobootwait 0 2 

我把三个驱动器里面,但只有一个自动安装(drive3,drive2仍然连接到外部)

 $ mount | grep /dev/sd /dev/sdc1 on /boot type ext2 (rw) /dev/sdb1 on /mnt/drive3 type ext4 (rw) /dev/sdf1 on /mnt/drive2 type ext4 (rw) 

但他们都显示:

 $ sudo fdisk -l WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sda: 120.0 GB, 120034123776 bytes <snip> Disk /dev/sdb: 5001.0 GB, 5000981078016 bytes 255 heads, 63 sectors/track, 608001 cylinders, total 9767541168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xdd494cbf Device Boot Start End Blocks Id System /dev/sdb1 1 4294967295 2147483647+ ee GPT Partition 1 does not start on physical sector boundary. Disk /dev/sdd: 5001.0 GB, 5000981078016 bytes 42 heads, 62 sectors/track, 3750975 cylinders, total 9767541168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xec15dda8 Device Boot Start End Blocks Id System /dev/sdd1 256 1220942644 610471194+ 83 Linux Disk /dev/sde: 5001.0 GB, 5000981078016 bytes 255 heads, 63 sectors/track, 608001 cylinders, total 9767541168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x4cd5215a Device Boot Start End Blocks Id System /dev/sde1 63 1220942644 610471291 83 Linux Partition 1 does not start on physical sector boundary. Disk /dev/sdc: 500.1 GB, 500107862016 bytes <snip> Disk /dev/sdf: 5001.0 GB, 5000981073920 bytes 255 heads, 63 sectors/track, 76000 cylinders, total 1220942645 sectors Units = sectors of 1 * 4096 = 4096 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x6b6805d9 Device Boot Start End Blocks Id System /dev/sdf1 63 1220942644 588803032 83 Linux $ ls /dev/sd* /dev/sda /dev/sda1 /dev/sdb /dev/sdb1 /dev/sdc /dev/sdc1 /dev/sdc2 /dev/sdc5 /dev/sdd /dev/sdd1 /dev/sde /dev/sde1 /dev/sdf /dev/sdf1 

如果我尝试正常挂载

 $ sudo mkdir /mnt/temp $ sudo mount -t ext4 /dev/sde1 /mnt/temp mount: wrong fs type, bad option, bad superblock on /dev/sde1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so $ dmesg | tail [87143.301150] EXT4-fs (sde1): VFS: Can't find ext4 filesystem [87295.537835] EXT4-fs (sde1): VFS: Can't find ext4 filesystem [87315.780147] EXT4-fs (sde1): VFS: Can't find ext4 filesystem [87315.780290] EXT4-fs (sde1): VFS: Can't find ext4 filesystem [87315.780421] EXT4-fs (sde1): VFS: Can't find ext4 filesystem 

该机器有5个SATA端口,我也买了一个PCIe SATA控制器,并尝试过。 没有不同。 在端口之间移动设备仍然没有区别。 另外两个驱动器总是安装。

我用USB控制器把它们放回到各自的shell中,然后工作。 尽pipe当我尝试使用直接连接的其中一个驱动器的情况下,它不被识别。

谢谢!

编辑:从gdisk添加输出

 $ sudo gdisk /dev/sde GPT fdisk (gdisk) version 0.8.8 Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: not present *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if you don't want to convert your MBR partitions to GPT format! *************************************************************** Command (? for help): p Disk /dev/sde: 9767541168 sectors, 4.5 TiB Logical sector size: 512 bytes Disk identifier (GUID): 00C22148-8C82-4062-BEC5-6759E7E23856 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 9767541134 Partitions will be aligned on 8-sector boundaries Total free space is 8546598519 sectors (4.0 TiB) Number Start (sector) End (sector) Size Code Name 1 63 1220942644 582.2 GiB 8300 Linux filesystem $ sudo gdisk /dev/sdb GPT fdisk (gdisk) version 0.8.8 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Command (? for help): p Disk /dev/sdb: 9767541168 sectors, 4.5 TiB Logical sector size: 512 bytes Disk identifier (GUID): E76C335B-FBA1-4FE0-9DC2-C5CADBECA6B0 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 9767541133 Partitions will be aligned on 8-sector boundaries Total free space is 0 sectors (0 bytes) Number Start (sector) End (sector) Size Code Name 1 34 9767541133 4.5 TiB 8300 disk4 

有趣的是,看起来像不装载使用MBR而不是GPT的磁盘?

这听起来像在https://superuser.com/questions/679725/how-to-correct-512-byte-sector-mbr-on-a-4096-byte-sector-disk中描述的问题:USB机箱报告不同于主板的扇区大小,因此分区表的解释不同&#x3002;

我有一个类似的问题,我已经从一个USB机箱转移到一个内部SATA端口的4TB磁盘。 显然USB机箱已经报告了4K个扇区,因此我能够使用老式的MBR分区表创build一个4TB的ext4分区。 通过SATA连接磁盘后,ext4分区不再被发现,显然是因为该磁盘现在用512B扇区访问。

我用下面的步骤解决了这个问题,使用Ubuntu中提供的Testdisk数据恢复工具:

  • 创build了原始分区表( sfdisk -d /dev/sdb > sfdisk-sdb.txtsfdisk -d /dev/sdb > sfdisk-sdb.txt ,以确保安全
  • 使用testdisk /dev/sdb来查找原始的ext4文件系统
  • 让testdisk将新的MBR分区表写入磁盘
  • 因为MBR表不支持4TB分区,ext4分区仍然无法装入,并且EXT4-fs (sdb1): bad geometry: block count 976751744 exceeds size of device (536870911 blocks)错误EXT4-fs (sdb1): bad geometry: block count 976751744 exceeds size of device (536870911 blocks)
  • 使用gdisk /dev/sdb将MBR转换为GPT格式,并将GPT写入磁盘
  • 再次使用testdisk /dev/sdb来查找原始的ext4文件系统(它检测到了错误的文件系统types,但这并不重要),并且让它将一个新的GPT表写入磁盘
  • 使用gdisk /dev/sdb将错误检测到的文件系统types更改为8300

也许我只是很幸运,但在这个过程后,ext4文件系统可以照常安装。 fsck -f /dev/sdb1未检测到任何错误, blkid /dev/sdb1tune2fs /dev/sdb1结果与使用USB机箱时相同。