Ste*_*day 1 ubuntu ext4 hard-drive mount sata
我有 4 个外部驱动器通过 USB 连接到我的 Dell Precision 490 工作站。
它们通过 uuid 位于 /etc/fstab 中,并格式化为 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
Run Code Online (Sandbox Code Playgroud)
我在里面放了三个驱动器,但只有一个自动挂载(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)
Run Code Online (Sandbox Code Playgroud)
但他们都出现了:
$ 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
Run Code Online (Sandbox Code Playgroud)
如果我尝试正常安装:
$ 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
Run Code Online (Sandbox Code Playgroud)
该机器有 5 个 SATA 端口,我还买了一个 PCIe SATA 控制器并尝试了一下。没有不同。在端口之间移动设备仍然不会产生任何差异。其他两个驱动器始终安装。
我用 USB 控制器将它们放回各自的外壳中,它们就可以工作了。尽管当我尝试使用直接连接的驱动器之一的外壳时,它未被识别。
谢谢!
$ 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
Run Code Online (Sandbox Code Playgroud)
有趣的是,看起来不挂载的磁盘使用的是 MBR 而不是 GPT?
这听起来像https://superuser.com/questions/679725/how-to- Correct-512-byte-sector-mbr-on-a-4096-byte-sector-disk 中描述的问题:USB 外壳报告了扇区大小与主板不同,因此分区表的解释也不同。
我在使用 4TB 磁盘时遇到了类似的问题,该磁盘已从 USB 外壳移至内部 SATA 端口。显然 USB 外壳报告了 4k 扇区,因此我能够使用老式的 MBR 分区表来创建 4TB ext4 分区。通过SATA连接磁盘后,再也找不到ext4分区,显然是因为现在使用512B扇区访问磁盘。
我使用Ubuntu 中提供的Testdisk数据恢复工具通过以下步骤解决了这个问题:
sfdisk -d /dev/sdb > sfdisk-sdb.txt
)testdisk /dev/sdb
查找原始的ext4文件系统EXT4-fs (sdb1): bad geometry: block count 976751744 exceeds size of device (536870911 blocks)
gdisk /dev/sdb
将MBR转换为GPT格式,并将GPT写入磁盘testdisk /dev/sdb
找到原始的ext4文件系统(它检测到错误的文件系统类型,但这并不重要),并让它将新的GPT表写入磁盘gdisk /dev/sdb
将错误检测到的文件系统类型更改为8300
也许我只是运气好,但在这个过程之后,ext4 文件系统可以像往常一样挂载。fsck -f /dev/sdb1
没有检测到任何错误,并且blkid /dev/sdb1
给出tune2fs /dev/sdb1
了与使用 USB 外壳时相同的结果。
归档时间: |
|
查看次数: |
3769 次 |
最近记录: |