更多: zhilu jiaocheng

解决方案

  1. 本例中的磁盘为/dev/sxx。

首先禁用 U 盘上的只读模式。
确保安装了 hdparm,然后运行以下命令:

# hdparm -r0 /dev/sxx
  1. 确保安装了util-linux 包,然后清除文件系统。
# wipefs --all /dev/sxx --force
  1. 使用 fdisk 在磁盘上创建一个新分区:
# fdisk -cu /dev/sxx

然后 'd' 删除,'w' 写入。

  1. 磁盘现在可以格式化了。
    要使用 ext4 文件系统格式化磁盘,可以使用以下命令:
# mkfs.ext4 /dev/sxx

问题

在格式化以写保护模式挂载的 U盘时,我们收到以下错误:

fdisk: Unable to write /dev/sdg: Bad file descriptor
使用fdisk 格式化 U盘时报错: Unable to write /dev/sdg: Bad file descriptor
日期:2020-09-17 00:13:04 来源:oir作者:oir