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