fdisk 未完成并挂在 USB 驱动器上

fdisk 未完成并挂在 USB 驱动器上

fdisk 问题。

操作系统:Linux CentOS 7

我在 USB 驱动器上使用了 fdisk。它挂起了,我无法将其关闭或退出。

另一个问题是,从那时起,为了解决这个问题,我物理上移除了 /dev/ 中显示的其他 USB 驱动器。然而,即使不再物理连接,它们仍然显示在 /dev/ 中。

这是 lsblk(我从这个列表中删除了列出的其他设备) lsblk

NAME                    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdf                       8:80   0   1.8T  0 disk 
└─sdf1                    8:81   0   1.8T  0 part 
sr0                      11:0    1  1024M  0 rom  

我根据朋友为我格式化另一个 USB 驱动器(完全相同的 USB 驱动器类型)时所做的笔记做出了以下选择。目的是将其格式化为 ext4。

以下是一组选项(加粗):

[root@linux18 ~]# fdisk /dev/sdf
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): **m**
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): **d**
Selected partition 1
Partition 1 is deleted

Command (m for help): **n**
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-3906963455, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3906963455, default 3906963455): 
Using default value 3906963455
Partition 1 of type Linux and of size 1.8 TiB is set

Command (m for help): **t**
Selected partition 1
Hex code (type L to list all codes): 83
Changed type of partition 'Linux' to 'Linux'

Command (m for help): **w**
The partition table has been altered!

这里我尝试了 Control C 和 Control Z:

^[[B^[[B^[[B

^[[6~

^C^[[5~

答案1

这看起来与您所面临的问题非常类似:https://access.redhat.com/solutions/369623

也许可以尝试# dmsetup remove使用手册页中的某些标志(--force --deferred --retry

答案2

对我来说,我需要强制重新扫描连接到系统的磁盘,如所述这里,例如:

echo "- - -" >> /sys/class/scsi_host/host_0/scan

相关内容