LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-08-2015, 11:29 AM   #1
eternalnewbee
LQ Newbie
 
Registered: Nov 2015
Distribution: Fedora
Posts: 7

Rep: Reputation: Disabled
badblocks command detaches USB HDD


Hi, I'm trying to test an external harddrive for bad blocks. I read here that
Code:
badblocks -nvs /dev/sdb
is a non-intrusive way to do that.

I ran that command on a 500G disk partitioned like below:
Code:
# fdisk -l /dev/sdb

Disk /dev/sdb: 465.8 GiB, 500107835392 bytes, 976773116 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
Disklabel type: gpt
Disk identifier: 53408F90-D794-4F19-B3CF-838ED197EAB9

Device     Start       End   Sectors   Size Type
/dev/sdb1   2048 976773082 976771035 465.8G Linux filesystem
I get the following repeatable behaviour:

After a minute or two, I hear the little desktop sound that announces a usb detachment (pitch going down) and immediately afterwards, a re-attachment sound (pitch going up), and more or less at the same time badblocks starts spewing a sequence of consecutive block numbers, which I interpret as being (and wish to be) the consequence of the detachment, not of actual bad blocks.

The following lines get output by
Code:
journalctl
in the process:

Code:
Nov 08 18:15:33 holland kernel: usb 2-2: USB disconnect, device number 14
Nov 08 18:15:33 holland kernel: scsi 19:0:0:0: rejecting I/O to offline device
Nov 08 18:15:33 holland kernel: scsi 19:0:0:0: [sdb] killing request
Nov 08 18:15:33 holland kernel: scsi 19:0:0:0: [sdb] FAILED Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
Nov 08 18:15:33 holland kernel: scsi 19:0:0:0: [sdb] CDB: Read(10) 28 00 00 01 d3 80 00 00 80 00
Nov 08 18:15:33 holland kernel: blk_update_request: I/O error, dev sdb, sector 119680
Nov 08 18:15:33 holland kernel: buffer_io_error: 2335390 callbacks suppressed
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117634, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117635, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117636, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117637, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117638, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117639, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117636, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117637, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117638, async page read
Nov 08 18:15:33 holland kernel: Buffer I/O error on dev sdb1, logical block 117639, async page read
Nov 08 18:15:33 holland systemd-udevd[760]: error opening USB device 'descriptors' file
Nov 08 18:15:33 holland kernel: usb 2-2: new SuperSpeed USB device number 15 using xhci_hcd
Nov 08 18:15:33 holland kernel: usb 2-2: New USB device found, idVendor=152d, idProduct=0539
Nov 08 18:15:33 holland kernel: usb 2-2: New USB device strings: Mfr=10, Product=11, SerialNumber=3
Nov 08 18:15:33 holland kernel: usb 2-2: Product: USB3.0 to ATA/ATAPI bridge
Nov 08 18:15:33 holland kernel: usb 2-2: Manufacturer: JMicron
Nov 08 18:15:33 holland kernel: usb 2-2: SerialNumber: 00A123456789
Nov 08 18:15:33 holland kernel: usb-storage 2-2:1.0: USB Mass Storage device detected
Nov 08 18:15:33 holland kernel: usb-storage 2-2:1.0: Quirks match for vid 152d pid 0539: 4000000
Nov 08 18:15:33 holland kernel: scsi host20: usb-storage 2-2:1.0
Nov 08 18:15:33 holland mtp-probe[5751]: checking bus 2, device 15: "/sys/devices/pci0000:00/0000:00:14.0/usb2/2-2"
Nov 08 18:15:33 holland mtp-probe[5751]: bus: 2, device: 15 was not an MTP device
Nov 08 18:15:34 holland kernel: scsi 20:0:0:0: Direct-Access     WDC WD50 00BEVT-22ZAT0    0107 PQ: 0 ANSI: 6
Nov 08 18:15:34 holland kernel: sd 20:0:0:0: Attached scsi generic sg2 type 0
Nov 08 18:15:34 holland kernel: sd 20:0:0:0: [sdc] 976773116 512-byte logical blocks: (500 GB/465 GiB)
Nov 08 18:15:34 holland kernel: sd 20:0:0:0: [sdc] Write Protect is off
Nov 08 18:15:34 holland kernel: sd 20:0:0:0: [sdc] Mode Sense: 27 00 00 00
Nov 08 18:15:34 holland kernel: sd 20:0:0:0: [sdc] No Caching mode page found
Nov 08 18:15:34 holland kernel: sd 20:0:0:0: [sdc] Assuming drive cache: write through
Nov 08 18:15:34 holland kernel:  sdc: sdc1
Nov 08 18:15:34 holland kernel: sd 20:0:0:0: [sdc] Attached SCSI disk
Nov 08 18:15:38 holland kernel: buffer_io_error: 4579902 callbacks suppressed
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262688, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262689, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262690, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262691, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262692, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262693, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262694, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262695, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262688, async page read
Nov 08 18:15:38 holland kernel: Buffer I/O error on dev sdb1, logical block 1262689, async page read
Nov 08 18:15:39 holland kernel: ------------[ cut here ]------------
Nov 08 18:15:39 holland kernel: WARNING: CPU: 0 PID: 5741 at fs/block_dev.c:56 __blkdev_put+0xc1/0x220()
Nov 08 18:15:39 holland kernel: Modules linked in: uas usb_storage bnep bluetooth ccm fuse xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat tun bridge stp llc nf_conntrack_ipv4 nf_defrag_ipv4 ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_conntrack nf_conntrack ip6table_filter ip6_tables vfat fat arc4 ath9k ath9k_common ath9k_hw ath intel_rapl iosf_mbi mac80211 x86_pkg_temp_thermal uvcvideo coretemp kvm_intel kvm videobuf2_vmalloc videobuf2_core videobuf2_memops iTCO_wdt iTCO_vendor_support snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic v4l2_common videodev snd_hda_intel snd_hda_controller media cfg80211 snd_hda_codec snd_hda_core toshiba_acpi snd_soc_rt5640 snd_soc_rl6231 snd_soc_core snd_compress snd_pcm_dmaengine rtsx_pci_ms regmap_i2c
Nov 08 18:15:39 holland kernel:  memstick snd_hwdep sparse_keymap i2c_designware_platform snd_seq snd_seq_device rfkill wmi snd_pcm i2c_designware_core toshiba_haps toshiba_bluetooth mei_me snd_timer snd_soc_sst_acpi dw_dmac mei dw_dmac_core snd shpchp lpc_ich i2c_i801 soundcore nfsd auth_rpcgss nfs_acl lockd grace binfmt_misc sunrpc dm_crypt i915 rtsx_pci_sdmmc i2c_algo_bit r8169 drm_kms_helper crct10dif_pclmul crc32_pclmul crc32c_intel drm ghash_clmulni_intel rtsx_pci serio_raw mii mfd_core sdhci_acpi sdhci mmc_core i2c_hid video
Nov 08 18:15:39 holland kernel: CPU: 0 PID: 5741 Comm: badblocks Not tainted 4.1.10-100.fc21.x86_64 #1
Nov 08 18:15:39 holland kernel: Hardware name: TOSHIBA SATELLITE C50-B/ZSWAA, BIOS 1.20 04/11/2014
Nov 08 18:15:39 holland kernel:  0000000000000000 000000001addc482 ffff8800a1833d18 ffffffff81792d95
Nov 08 18:15:39 holland kernel:  0000000000000000 0000000000000000 ffff8800a1833d58 ffffffff810a166a
Nov 08 18:15:39 holland kernel:  0000000000000000 ffff880197a62bb8 ffff880197a62a40 ffff880197a62b30
Nov 08 18:15:39 holland kernel: Call Trace:
Nov 08 18:15:39 holland kernel:  [<ffffffff81792d95>] dump_stack+0x45/0x57
Nov 08 18:15:39 holland kernel:  [<ffffffff810a166a>] warn_slowpath_common+0x8a/0xc0
Nov 08 18:15:39 holland kernel:  [<ffffffff810a179a>] warn_slowpath_null+0x1a/0x20
Nov 08 18:15:39 holland kernel:  [<ffffffff812640e1>] __blkdev_put+0xc1/0x220
Nov 08 18:15:39 holland kernel:  [<ffffffff81264b70>] blkdev_put+0x50/0x140
Nov 08 18:15:39 holland kernel:  [<ffffffff81264d15>] blkdev_close+0x25/0x30
Nov 08 18:15:39 holland kernel:  [<ffffffff8122a45c>] __fput+0xdc/0x1f0
Nov 08 18:15:39 holland kernel:  [<ffffffff8122a5be>] ____fput+0xe/0x10
Nov 08 18:15:39 holland kernel:  [<ffffffff810bec74>] task_work_run+0xd4/0xf0
Nov 08 18:15:39 holland kernel:  [<ffffffff810a3f2d>] do_exit+0x30d/0xa70
Nov 08 18:15:39 holland kernel:  [<ffffffff81068cc1>] ? __do_page_fault+0x1c1/0x450
Nov 08 18:15:39 holland kernel:  [<ffffffff81794fef>] ? __schedule+0x2df/0x970
Nov 08 18:15:39 holland kernel:  [<ffffffff810a4725>] do_group_exit+0x45/0xb0
Nov 08 18:15:39 holland kernel:  [<ffffffff810a47a4>] SyS_exit_group+0x14/0x20
Nov 08 18:15:39 holland kernel:  [<ffffffff8179966e>] system_call_fastpath+0x12/0x71
Nov 08 18:15:39 holland kernel: ---[ end trace f0cab859e405a82c ]---
Nov 08 18:15:40 holland abrt-dump-journal-oops[1039]: abrt-dump-journal-oops: Found oopses: 1
Nov 08 18:15:40 holland abrt-dump-journal-oops[1039]: abrt-dump-journal-oops: Creating problem directories
Nov 08 18:15:40 holland abrt-server[5760]: Looking for kernel package
Nov 08 18:15:40 holland abrt-server[5760]: Kernel package kernel-core-4.1.10-100.fc21.x86_64 found
Nov 08 18:15:41 holland dbus[976]: [system] Activating service name='org.freedesktop.problems' (using servicehelper)
Nov 08 18:15:41 holland dbus[976]: [system] Successfully activated service 'org.freedesktop.problems'
Nov 08 18:15:41 holland abrt-dump-journal-oops[1039]: Reported 1 kernel oopses to Abrt
Thinking that the badblocks command might have screwed up the kernel's idea of existing partitions and thus of available devices, I also tried

Code:
badblocks -nvs /dev/sdb1
but that didn't help.

I have a number of questions:
1. Is this expected behavior?
2.a. If yes, does it mean that the disk has bad blocks?
2.b. If no, can I do something about it?

Thanks!

P.S. The partition doesn't get auto-mounted: In dconf-editor > org.gnome.desktop.media-handling I have everything un-selected.

Last edited by eternalnewbee; 11-08-2015 at 12:46 PM.
 
Old 11-08-2015, 04:46 PM   #2
eternalnewbee
LQ Newbie
 
Registered: Nov 2015
Distribution: Fedora
Posts: 7

Original Poster
Rep: Reputation: Disabled
Update:

The disk and/or USB bridge in question has started to disconnect at random moments, i.e. independently of the badblocks command.

Consider the issue closed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File system for HDD with random appear BadBlocks. StreamThreader Slackware 1 09-03-2013 08:12 PM
2TB HDD and badblocks dimm0k Linux - Newbie 9 06-19-2010 12:20 AM
badblocks command Walman Linux - Software 2 04-13-2007 03:33 PM
Regarding badblocks command in linux Jayaraghavendran Linux - Software 2 04-27-2006 02:17 AM
Madrake Rescue - Badblocks command not found ggard Mandriva 0 01-26-2005 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration