LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-29-2017, 07:16 PM   #1
Exterminator13
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Rep: Reputation: Disabled
USB HDD Case: can't mount the 2nd ext4 partition!


I bought a USB 3.0 External 3.5" HDD Case.
It is based on the following chip: JMicron JMS567

I want to use it for attaching my internal HDD which has 3 partitions: swap and two ext4 partitions.

For testing purposes, I took my old 200GB HDD, which had 2 partitions: first is a little NTFS partition, and the 2nd one is an ext4 partition.

My PC is running under Linux Mint 17.2, x86_64, kernel 4.4.
When I connected the HDD case to my PC, I could access the first NTFS partition, but it was impossible to access the 2nd ext4 partition! I also tried the USB case on Arch 2017.8 (VirtualBox). The same issue!

The following is what dmesg says on mount fail:
Code:
[288545.313432] usb 2-1: Manufacturer: USB to ATA/ATAPI Brid
[288545.315301] scsi 13:0:0:0: Direct-Access     USB3.0                    8105 PQ: 0 ANSI: 6
[288545.316566] sd 13:0:0:0: Attached scsi generic sg3 type 0
[288545.316924] sd 13:0:0:0: [sdd] Spinning up disk...
[288546.320008] ........ready
[288553.348408] sd 13:0:0:0: [sdd] 390719855 512-byte logical blocks: (200 GB/186 GiB)
[288553.348411] sd 13:0:0:0: [sdd] 4096-byte physical blocks
[288553.349402] sd 13:0:0:0: [sdd] Write Protect is off
[288553.349405] sd 13:0:0:0: [sdd] Mode Sense: 53 00 00 08
[288553.349903] sd 13:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[288553.362536]  sdd: sdd1 sdd2
[288553.362593] sdd: p2 size 384428032 extends beyond EOD, enabling native capacity
[288553.366410]  sdd: sdd1 sdd2
[288553.366457] sdd: p2 size 384428032 extends beyond EOD, truncated
[288553.394656] sd 13:0:0:0: [sdd] Attached SCSI disk
[288554.138776] EXT4-fs (sdd2): bad geometry: block count 48053504 exceeds size of device (48053293 blocks)
[288555.667902] EXT4-fs (sdd2): bad geometry: block count 48053504 exceeds size of device (48053293 blocks)
I'm 100% sure that my disk has no errors! I tested it when it was connected to my PC as a regular SATA HDD!

The most funny thing is that under Windows 7 I installed ext2fsd driver which allows to access ext4 partitions under Windows. So, under Win 7 I can access the 2nd ext4 partition without any problems!

This is definitely a USB driver issue!

My 200GB disk params when it was connected as a SATA drive (I set bold values which differ when the disk is connected via USB):

Code:
fdisk -l /dev/sdd

Disk /dev/sdd: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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
Disk identifier: 0xe1751117

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048     6293503     3145728    7  HPFS/NTFS/exFAT
/dev/sdd2         6293504   390721535   192214016   83  Linux


hdparm -I /dev/sdd

/dev/sdd:

ATA device, with non-removable media
        Model Number:       WDC WD2000JS-00MHB0                     
        Serial Number:      WD-WMANL1143240
        Firmware Revision:  02.01C03
Standards:
        Supported: 7 6 5 4 
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors:  390721968
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:      190782 MBytes
        device size with M = 1000*1000:      200049 MBytes (200 GB)
        cache/buffer size  = 8192 KBytes
The same disk, but now connected via USB HDD case:

Code:
fdisk -l /dev/sdd

Disk /dev/sdd: 200.0 GB, 200048565760 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390719855 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disk identifier: 0xe1751117

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048     6293503     3145728    7  HPFS/NTFS/exFAT
/dev/sdd2         6293504   390721535   192214016   83  Linux



hdparm -I /dev/sdd

/dev/sdd:

ATA device, with non-removable media
        Model Number:       WDC WD2000JS-00MHB0                     
        Serial Number:      WD-WMANL1143240
        Firmware Revision:  02.01C03
Standards:
        Supported: 7 6 5 4 
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors:  390719855
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:      190781 MBytes
        device size with M = 1000*1000:      200048 MBytes (200 GB)
        cache/buffer size  = 8192 KBytes

As you can see the geometry is wrong, because sector size is wrong... Maybe, there's any param in mount options which allows to set block/sector size? Or any other solution?
Thank you!


P. S. Detailed USB chip description:
Code:
Bus 002 Device 004: ID 152d:2590 JMicron Technology Corp. / JMicron USA Technology Corp. Seatay ATA/ATAPI Bridge
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x152d JMicron Technology Corp. / JMicron USA Technology Corp.
  idProduct          0x2590 Seatay ATA/ATAPI Bridge
  bcdDevice           81.05
  iManufacturer           1 USB to ATA/ATAPI Brid
  iProduct                2 Generic USB Device
  iSerial                 3 00A12345AFC0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           85
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 USB Mass Storage
    bmAttributes         0xc0
      Self Powered
    MaxPower               30mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              6 MSC Bulk-Only Transport
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           4
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98 
      iInterface             10 MSC USB Attached SCSI
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        Command pipe (0x01)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        Status pipe (0x02)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        Data-in pipe (0x03)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        Data-out pipe (0x04)
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat          32 micro seconds
Device Status:     0x0001
  Self Powered
 
Old 11-30-2017, 08:57 AM   #2
giis
Member
 
Registered: Nov 2013
Location: Third Rock from Moon
Distribution: RPM/DEB based and LFS
Posts: 65

Rep: Reputation: Disabled
If your ext4 (/dev/sdd2) doesn't have important data. Can you reformat & check again?

Similar issue: https://unix.stackexchange.com/a/188001/28810

Last edited by giis; 11-30-2017 at 08:58 AM.
 
Old 11-30-2017, 09:21 AM   #3
Exterminator13
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by giis View Post
If your ext4 (/dev/sdd2) doesn't have important data. Can you reformat & check again?
Sure, I tried to reformat in GParted, when an HDD was connected via USB. I've created one ext4 partition. During mount, the system claims on "bad geometry"
 
Old 11-30-2017, 09:31 AM   #4
Exterminator13
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I've finally found the solution!

Assume your disk is /dev/sdd, and it has 2 partitions: /dev/sdd1 and /dev/sdd2

The solution:

Code:
sudo apt-get install fuseext2

sudo fuseext2 -o rw+,sync_read /dev/sdd2 /mnt
Or, instead of the last command, you can write the mount command:

Code:
sudo mount -t fuse-ext2 -o rw+,sync_read /dev/sdd2 /mnt
At least, I can reach my data!
But, of course, I would be very grateful to somebody who will explain to me how to make my USB case working via regular mount command!

P.S. I've created a duplicate of this thread here
 
Old 11-30-2017, 10:34 AM   #5
Exterminator13
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Finally! I've found the solution which allows to use a regular mount command:

Code:
sudo resize2fs -f /dev/sdd2
That's an output:

Code:
Resizing the filesystem on /dev/sdd2 to 48053293 (4k) blocks.
The filesystem on /dev/sdd2 is now 48053293 blocks long.
This command does not delete data which is very important!

After that I am able to open both partitions with standard filesystem tools!

Last edited by Exterminator13; 11-30-2017 at 10:45 AM.
 
Old 11-30-2017, 11:18 PM   #6
giis
Member
 
Registered: Nov 2013
Location: Third Rock from Moon
Distribution: RPM/DEB based and LFS
Posts: 65

Rep: Reputation: Disabled
I was about to suggest "resize2fs" if re-formatting it didn't work. Glad to hear "resize2fs" worked!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i want a new partition for external usb hdd, replace ntfs with ext4 with debian tools malt Linux - Newbie 2 10-23-2014 05:10 PM
Can I Mount Win98/XP HDD, via USB Case, in Ubuntu? GNewbie Ubuntu 5 04-21-2008 01:48 PM
How to auto mount a 2nd hdd Adam555 Linux - Newbie 2 01-22-2008 03:56 AM
How to format & mount 2nd hdd after FedCor1 has been installed on 1st hdd? clay394 Fedora 1 05-18-2004 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration