格式化硬盘失败

Gab*_*tos 4 format hard-drive

我对 ubuntu 相当陌生,所以如果我问一个愚蠢的问题,请不要咬我的头。

无论如何,我尝试使用 gnome 磁盘工具格式化我的一个硬盘驱动器,但返回错误。

Error creating file system: Command-line `mkntfs -f -F -L "New Volume" "/dev/sdb"' exited with non-zero exit status 1:
stdout: `Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
'
stderr: `/dev/sdb is entire device, not just one partition.
mkntfs forced anyway.
Error writing to /dev/sdb: Input/output error
Error writing non-resident attribute value.
add_attr_sd failed: Input/output error
Couldn't create root directory: Input/output error
Failed to fsync device /dev/sdb: Input/output error
Warning: Could not close /dev/sdb: Input/output error
' (udisks-error-quark, 0)
Run Code Online (Sandbox Code Playgroud)

我不知道这个错误意味着什么,以及我应该如何格式化我的硬盘(如果我仍然能够)。这是否意味着我的硬盘驱动器被炸了,我可以把它扔掉,还是我仍然可以保存它?

编辑:

使用sudo fdisk -l返回以下输出:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0x00084eb8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   312580095   156039169    5  Extended
/dev/sda5          501760   312580095   156039168   8e  Linux LVM

Disk /dev/sdc: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders, total 160086528 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: 0xd30c01f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   160083967    80040960    7  HPFS/NTFS/exFAT

Disk /dev/mapper/ubuntu-root: 237.4 GB, 237447938048 bytes
255 heads, 63 sectors/track, 28868 cylinders, total 463765504 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: 0x00000000

Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table

Disk /dev/mapper/ubuntu-swap_1: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders, total 8388608 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: 0x00000000

Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition table
Run Code Online (Sandbox Code Playgroud)

但这似乎不包含我要格式化的硬盘驱动器。显示的另外两个设备(/dev/sda 和 /dev/sdc)是我组合成一个逻辑视图的设备。第三个,或者我应该说第二个 (/dev/sdb) 从来没有出现在这个列表中,而只出现在 gnome 磁盘实用程序中。从命令行格式化它,以及从实用程序格式化它返回相同的结果。

编辑2:

使用sudo parted -l返回以下内容:

    Model: ATA MAXTOR STM316021 (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type      File system  Flags
 1      1049kB  256MB  255MB  primary   ext2         boot
 2      257MB   160GB  160GB  extended
 5      257MB   160GB  160GB  logical                lvm


Error: /dev/sdb: unrecognised disk label                                  

Model: ATA Maxtor 6Y080L0 (scsi)
Disk /dev/sdc: 82.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  82.0GB  82.0GB  primary


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu-root: 237GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system  Flags
 1      0.00B  237GB  237GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu-swap_1: 4295MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  4295MB  4295MB  linux-swap(v1)
Run Code Online (Sandbox Code Playgroud)

如图所示,我的 /dev/sdb 设备无法识别 ( Error: /dev/sdb: unrecognised disk label)。这应该让我更接近解决方案,如果我知道该怎么做就好了。

编辑 3:

经过进一步研究,我发现我的硬盘驱动器没有分区表,我无法在设备上创建分区表,因为我的计算机将其检测为长度为零的分区。

我将不得不减少损失并接受它已经死了的事实。无论如何感谢您的帮助。

pro*_*201 6

在创建文件系统之前,您必须创建一个分区。

  • sudo fdisk /dev/sdX
    其中“X”是驱动器号(如 sda 或 sdb 取决于驱动器)。

  • n => 创建新分区(然后创建你需要的)

  • t => 指定类型(我认为NTFS是07,但你可以用L查看列表)

  • w => 将更改写入磁盘并退出

现在您可以使用sudo mkfs.ntfs /dev/sdX1“x”是上面的驱动器号来创建文件系统。添加您需要的配置参数。