0

When I try to connect my SATA HDD via USB to my laptop running Debian 8, the system hangs, responds extremely slowly and running ls /dev | grep sd* shows entries ranging from sdc1 to sdc99 that are not present when the HDD is unplugged.

I really need to format that hard drive because a Windows 10 installation failed and now I can neither boot the Linux distro nor the Windows 7 installation which were originally installed.

Also when I try to connect the HDD to my Laptop running Windows 10 I can't find it anywhere, not even under disk management in the administrative tools.


As requested, the last few lines of the syslog messages:

Jan 31 19:03:53 debian kernel: [   85.602048] scsi 4:0:0:0: Direct-Access        Mass  Storage Device        PQ: 0 ANSI: 0
Jan 31 19:03:53 debian kernel: [   85.602324] sd 4:0:0:0: Attached scsi generic sg2 type 0
Jan 31 19:03:53 debian kernel: [   85.602598] sd 4:0:0:0: [sdb] 488397166 512-byte logical blocks: (250 GB/232 GiB)
Jan 31 19:03:53 debian kernel: [   85.602732] sd 4:0:0:0: [sdb] Write Protect is off
Jan 31 19:03:53 debian kernel: [   85.602735] sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
Jan 31 19:03:53 debian kernel: [   85.602865] sd 4:0:0:0: [sdb] No Caching mode page found
Jan 31 19:03:53 debian kernel: [   85.604123] sd 4:0:0:0: [sdb] Assuming drive cache: write through
Jan 31 19:03:53 debian kernel: [   85.664976]  sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 sdb8 sdb9 sdb10 sdb11 sdb12 sdb13 sdb14 sdb15 sdb16 sdb17 sdb18 sdb19 sdb20 sdb21 sdb22 sdb23 sdb24 sdb25 sdb26 sdb27 sdb28 sdb29 sdb30 sdb31 sdb32 sdb33 sdb34 sdb35 sdb36 sdb37 sdb38 sdb39 sdb40 sdb41 sdb42 sdb43 sdb44 sdb45 sdb46 sdb47 sdb48 sdb49 sdb50 sdb51 sdb52 sdb53 sdb54 sdb55 sdb56 sdb57 sdb58 sdb59 sdb60 sdb61 sdb62 sdb63 sdb64 sdb65 sdb66 sdb67 sdb68 sdb69 sdb70 sdb71 sdb72 sdb73 sdb74 sdb75 sdb76 sdb77 sdb78 sdb79 sdb80 sdb81 sdb82 sdb83 sdb84 sdb85 sdb86 sdb87 sdb88 sdb89 sdb90 sdb91 sdb92 sdb93 sdb94 sdb95 sdb96 sdb97 sdb98 sdb99 sdb100 sdb101 sdb102 sdb103 sdb104 sdb105 sdb106 sdb107 sdb108 sdb109 sdb110 sdb111 sdb112 sdb113 sdb114 sdb115 sdb116 sdb117 sdb118 sdb119 sdb120 sdb121 sdb122 sdb123 sdb124 sdb125 sdb126 sdb127 sdb128 sdb129 sdb130 sdb131 sdb132 sdb133 sdb134 sdb135 sdb136 sdb137 sdb138 sdb139 sdb140 sdb141 sdb142 sdb143 sdb144 sdb145 sdb146 sdb147 sdb148 sdb149 sdb150 sdb151 sdb152 sdb153 sdb154 sdb155 sdb1<5>[   85.685268] sd 4:0:0:0: [sdb] Attached SCSI disk

And the output of lsblk:

NAME     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda        8:0    0 931,5G  0 disk 
├─sda1     8:1    0   500M  0 part 
├─sda2     8:2    0 155,8G  0 part 
├─sda3     8:3    0 488,3G  0 part 
├─sda4     8:4    0     1K  0 part 
├─sda5     8:5    0  46,6G  0 part /
├─sda6     8:6    0 186,3G  0 part /home
├─sda7     8:7    0  14,9G  0 part [SWAP]
├─sda8     8:8    0  38,3G  0 part 
└─sda9     8:9    0   954M  0 part /boot
sdb        8:16   0 232,9G  0 disk 
├─sdb1     8:17   0   100M  0 part 
├─sdb2     8:18   0  97,1G  0 part 
├─sdb3     8:19   0   450M  0 part 
├─sdb4     8:20   0     1K  0 part 
├─sdb5     8:21   0   4,7G  0 part 
├─sdb6     8:22   0     2G  0 part 
├─sdb7     8:23   0   4,7G  0 part 
├─sdb8     8:24   0     2G  0 part 
├─sdb9     8:25   0   4,7G  0 part 
├─sdb10    8:26   0     2G  0 part 
├─sdb11    8:27   0   4,7G  0 part 
├─sdb12    8:28   0     2G  0 part 
├─sdb13    8:29   0   4,7G  0 part 
├─sdb14    8:30   0     2G  0 part 
--- this repeats itself numerous times with sdb until: ---
├─sdb249 259:233  0   4,7G  0 part 
├─sdb250 259:234  0     2G  0 part 
├─sdb251 259:235  0   4,7G  0 part 
├─sdb252 259:236  0     2G  0 part 
├─sdb253 259:237  0   4,7G  0 part 
├─sdb254 259:238  0     2G  0 part 
└─sdb255 259:239  0   4,7G  0 part 
sr0       11:0    1   7,9G  0 rom  /media/cdrom0

Maybe I should also mention that I selected a clean install when trying to install Windows 10 on that drive. It began installing but got stuck at copying the files, so I aborted. Probably most of the disk has been erased at that time, but not all. For example I could still get into GRUB and it showed me the options to boot Linux or Windows, but neither worked.

2
  • Can you provide the output of lsblk and check /var/log/syslog for anything abnormal when plugging in the external hard drive?
    – Deltik
    Commented Jan 31, 2016 at 17:58
  • Edited the answer. Thanks for the advice. You can see the numerous entries for sdb.
    – dudenr33
    Commented Jan 31, 2016 at 18:33

1 Answer 1

2

The drive /dev/sdb looks usable as a 250GB (232GiB) block device at first glance.

Linux has detected 255 partitions, which is the maximum supported by the kernel.

If you add up the sizes of all of the partitions shown in your lsblk ouput, you get 1TB (935GiB).

Do you have a 1TB hard drive or a 250GB hard drive?

250GB Hard Drive

Linux is likely seeing the whole hard drive, so it may be able to erase the partition table for you. The current partition table is lying about having 1TB of partitions.

Zap the hard drive to erase the partition table. Run one of the following commands to do the zapping:

dd if=/dev/zero of=/dev/sdb bs=2M count=1

sgdisk /dev/sdb -Z

Rescan partitions in /dev/sdb using this command:

partprobe /dev/sdb

You are supposed to receive the following error message:

Error: /dev/sdb: unrecognised disk label

This error means that the partition table is gone, as intended. You can run lsblk /dev/sdb again and see something like this:

# lsblk /dev/sdb
NAME     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb        8:16   0 232,9G  0 disk

1TB Hard Drive

This is an odd case where Linux detected that you only have a 250GB block device when your hard drive is actually 1TB large.

Your SATA-to-USB adapter might be incompatible with the hard drive that you're trying to use, or maybe Linux doesn't have the right driver for the adapter.

There's a possible explanation for this here.


Explaining the Slowness

As for why your computer became slow, Linux was probably trying to collect information (filesystems, UUIDs, etc.) from each of the partitions it detected, and there were 255 of them. This may take quite a bit of time and block other processes, which would make your computer slow.

1
  • Thank you very much for the detailed response. The drive in /dev/sdb is 250GB, but I also have a 1TB drive in the laptop itself, which is mounted as /dev/sda. I will plug the HDD in and wait some time until the system is responsive again and try your advice.
    – dudenr33
    Commented Jan 31, 2016 at 19:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .