我正在尝试使用 来格式化在另一台计算机上用作交换驱动器的 USB 磁盘gparted
。一直卡在下面的界面
iotop -o
显示没有 IO 活动。仅当格式化该特定驱动器时它才会冻结。我尝试过另外 2 根棍子,gparted
效果很好。有人知道如何解决这个问题吗?
编辑:
这是输出dmesg
:
[ 352.763146] usb 1-3: new high-speed USB device number 7 using ehci-pci
[ 352.912386] usb 1-3: New USB device found, idVendor=090c, idProduct=1000
[ 352.912387] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 352.912389] usb 1-3: Product: Flash Drive
[ 352.912389] usb 1-3: Manufacturer: Samsung
[ 352.912390] usb 1-3: SerialNumber: 0344818020002557
[ 352.917347] usb-storage 1-3:1.0: USB Mass Storage device detected
[ 352.917542] scsi host8: usb-storage 1-3:1.0
[ 354.102796] scsi 8:0:0:0: Direct-Access Samsung Flash Drive 1100 PQ: 0 ANSI: 6
[ 354.103526] sd 8:0:0:0: Attached scsi generic sg3 type 0
[ 354.106521] sd 8:0:0:0: [sdb] 62668800 512-byte logical blocks: (32.1 GB/29.9 GiB)
[ 354.108598] sd 8:0:0:0: [sdb] Write Protect is off
[ 354.108600] sd 8:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 354.109538] sd 8:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 354.126159] sd 8:0:0:0: [sdb] Attached SCSI removable disk
[16870.669971] usb 1-3: reset high-speed USB device number 7 using ehci-pci
[17038.471436] INFO: task scsi_eh_8:3326 blocked for more than 120 seconds.
[17038.471440] Tainted: P OE 4.13.0-46-generic #51-Ubuntu
[17038.471440] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[17038.471442] scsi_eh_8 D 0 3326 2 0x80000000
[17038.471443] Call Trace:
[17038.471460] __schedule+0x291/0x8a0
[17038.471461] schedule+0x2c/0x80
[17038.471462] schedule_preempt_disabled+0xe/0x10
[17038.471463] __mutex_lock.isra.2+0x18c/0x4d0
[17038.471465] __mutex_lock_slowpath+0x13/0x20
[17038.471466] ? __mutex_lock_slowpath+0x13/0x20
[17038.471467] mutex_lock+0x2f/0x40
[17038.471472] device_reset+0x22/0x50 [usb_storage]
[17038.471478] scsi_eh_ready_devs+0x333/0xbf0
[17038.471481] ? __pm_runtime_resume+0x5b/0x80
[17038.471483] ? scsi_try_target_reset+0x90/0x90
[17038.471484] scsi_error_handler+0x4c3/0x5b0
[17038.471489] kthread+0x128/0x140
[17038.471491] ? scsi_eh_get_sense+0x200/0x200
[17038.471492] ? kthread_create_on_node+0x70/0x70
[17038.471493] ret_from_fork+0x35/0x40
[17038.471496] INFO: task gpartedbin:29528 blocked for more than 120 seconds.
[17038.471498] Tainted: P OE 4.13.0-46-generic #51-Ubuntu
[17038.471499] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[17038.471500] gpartedbin D 0 29528 29523 0x00000000
[17038.471501] Call Trace:
[17038.471502] __schedule+0x291/0x8a0
[17038.471506] ? blk_finish_plug+0x2c/0x40
[17038.471507] schedule+0x2c/0x80
[17038.471510] io_schedule+0x16/0x40
[17038.471514] wait_on_page_bit_common+0xd8/0x160
[17038.471515] ? page_cache_tree_insert+0xc0/0xc0
[17038.471516] __filemap_fdatawait_range+0xfe/0x160
[17038.471517] file_write_and_wait_range+0x60/0xc0
[17038.471521] blkdev_fsync+0x1b/0x50
[17038.471523] vfs_fsync_range+0x4e/0xb0
[17038.471524] do_fsync+0x3d/0x70
[17038.471526] SyS_fsync+0x10/0x20
[17038.471527] entry_SYSCALL_64_fastpath+0x24/0xab
[17038.471528] RIP: 0033:0x7f624e231490
[17038.471529] RSP: 002b:00007ffce924b1c0 EFLAGS: 00000293 ORIG_RAX: 000000000000004a
[17038.471530] RAX: ffffffffffffffda RBX: 0000558e5fbd3f20 RCX: 00007f624e231490
[17038.471530] RDX: 0000000000000000 RSI: 0000558e5fc0e330 RDI: 0000000000000006
[17038.471531] RBP: 0000000000000001 R08: 0000558e5fc63d40 R09: 0000000000000000
[17038.471531] R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000010
[17038.471532] R13: 0000558e5f96c7a0 R14: 0000558e5f96c790 R15: 0000000000000000
smartctl
给出以下结果:
$ sudo smartctl --all /dev/sdb -d sat -T permissive
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.13.0-46-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
Read Device Identity failed: scsi error unsupported scsi opcode
=== START OF INFORMATION SECTION ===
Device Model: [No Information Found]
Serial Number: [No Information Found]
Firmware Version: [No Information Found]
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: [No Information Found]
Local Time is: Fri Apr 26 12:57:58 2019 AEST
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
答案1
使用不同的软件可以让您获得更好的视图。
#
在下面以 First开头的行中root
,请检查这是正确的磁盘!!!重要!!!如果您因为这些说明而丢失了所有数据,则后果自负。我会尽我所能地使用testdisk
或photorec
恢复。
# parted /dev/sdb
Model: Some disk model
Disk: /dev/sdb : 29.9GB
Sector Size: 512B/4096B
Partition Table: msdos
Disk Flags
创建分区表和交换分区
# parted /dev/sdb mklabel gpt #!!!ACHTUNG! This will erase ALL partitions on disk /dev/sdb!!!
# parted /dev/sdb mkpart primary linux-swap 512B 29.9GB
# parted print
Model: Some disk model
Disk: /dev/sdb : 29.9GB
Sector Size: 512B/4096B
Partition Table: mbr
Disk Flags
Number Start End Size File System Name Flags
1 512B 29.9Gb 29.9Gb primary
格式化交换分区
# mkswap /dev/sdb1
如果失败,您更有可能找到原因。但从输出的外观来看dmesg
,您的设备似乎已损坏。
您应该考虑使用它smartctl
来检查驱动器的 SMART 状态。要安装,您需要 smartmontools(debian、ubuntu、mint、devuan...)