harddisk não reconhecido / filesystem muito grande para montar com segurança neste sistema / hdparm mostra lixo

2

Eu tenho um disco rígido externo de 4 TB Verbatim com ext4.

Pode ser montado com sucesso no meu Raspberry Pi.

Estou tentando conectá-lo ao meu dispositivo WD Mybook Live Duo, no qual tenho acesso raiz SSH.

Quando eu conecto o dispositivo, recebo as seguintes mensagens dmesg :

usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: New USB device found, idVendor=18a5, idProduct=0400
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: USB 3.0 Desktop HD
usb 1-1: Manufacturer: Verbatim
usb 1-1: SerialNumber: 306239230569
usb 1-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver libusual
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
scsi 2:0:0:0: Direct-Access     ST4000DM 000-1F2168       CC52 PQ: 0 ANSI: 6
sd 2:0:0:0: Attached scsi generic sg2 type 0
sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).
usb-storage: device scan complete
sd 2:0:0:0: [sdc] 7814037168 512-byte logical blocks: (4.00 TB/3.63 TiB)
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Mode Sense: 1f 00 00 08
sd 2:0:0:0: [sdc] Assuming drive cache: write through
sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).
sd 2:0:0:0: [sdc] Assuming drive cache: write through
 sdc: sdc1
sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).
sd 2:0:0:0: [sdc] Assuming drive cache: write through
sd 2:0:0:0: [sdc] Attached SCSI disk

O tamanho de 4 TB parece ser reconhecido corretamente.

Observe que a mensagem Very big device. Trying to use READ CAPACITY(16). não parece ser um erro, já que isso acontece no meu Raspberry também, mas tudo funciona bem.

Aparecem os dispositivos /dev/sdc e /dev/sdc1 . Então, pelo menos, reconhece a tabela de partições, eu acho.

(Não consigo executar fdisk -l , pois ele não está instalado no dispositivo e não quero mexer muito nesse dispositivo)

Quando executo mount /dev/sdc1 ./mymountpoint/ , recebo o seguinte erro em dmesg :

EXT4-fs (sdc1): filesystem too large to mount safely on this system

hdparm -I /dev/sdc mostra lixo absoluto:

NAS:/DataVolume# hdparm -I /dev/sdc

/dev/sdc:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

ATA device, with removable media
        Serial Number:      abhs¦UU
        Media Serial Num:   ¦U¦¦yYT¦UU

        Media Manufacturer:  H

        Transport:          Parallel, ATA8-APT
Standards:
        Used: unknown (minor revision code 0x5555)
        Supported: 9 7 6 5
        Likely used: 9
Configuration:
        Logical         max     current
        cylinders       21845   0
        heads           4352    0
        sectors/track   61711   0
        --
        Logical  Sector size:                   512 bytes
        Physical Sector size:                  4096 bytes
        Logical Sector-0 offset:            2796032 bytes
        device size with M = 1024*1024:  2864663189 MBytes
        device size with M = 1000*1000:  3003817068 MBytes (3003817 GB)
        cache/buffer size  = unknown
        Nominal Media Rotation Rate: 11884
Capabilities:
        IORDY(may be)(can be disabled)
        Standby timer values: spec'd by Vendor
        R/W multiple sector transfer: Max = 0   Current = ?
        Recommended acoustic management value: 18, current value: 0
        DMA: sdma15
        PIO: unknown
           *    READ BUFFER DMA command
           *    Long physical sector diagnostics
           *    CFast specification support
Security:
        Master password revision code = 112
                supported
                enabled
                locked
        not     frozen
                expired: security count
                supported: enhanced erase
        Security level high
Logical Unit WWN Device Identifier: 776f000000000013
        NAA             : 7
        IEEE OUI        : 76f000
        Unique ID       : 000000013
Integrity word not set (found 0x1400, expected 0xbaa5)

NAS:/DataVolume# lsusb mostra:

Bus 001 Device 003: ID 18a5:0400 Verbatim, Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

O que posso fazer para que o disco rígido seja executado nesse sistema?

(Eu quero usá-lo para criar backups com rsync , pois minha rede é muito lenta)

Linux na framboesa:

uname --all
Linux raspberrypi 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux

Linux no NAS:

uname --all
Linux NAS 2.6.32.11-svn70860 #1 Thu May 17 13:32:51 PDT 2012 ppc GNU/Linux

UPDATE

Aqui estão os hdparm corretos que recebo de um Raspberry Pi ou de um Ubuntu Live CD:

desinfect@desinfect:/dev$ sudo hdparm -I /dev/sdb

/dev/sdb:

ATA device, with non-removable media
    Model Number:       ST4000DM000-1F2168                      
    Serial Number:      Z300ZT7T
    Firmware Revision:  CC52    
    Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
    Used: unknown (minor revision code 0x0029) 
    Supported: 8 7 6 5 
    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: 7814037168
    Logical  Sector size:                   512 bytes
    Physical Sector size:                  4096 bytes
    Logical Sector-0 offset:                  0 bytes
    device size with M = 1024*1024:     3815447 MBytes
    device size with M = 1000*1000:     4000787 MBytes (4000 GB)
    cache/buffer size  = unknown
    Form Factor: 3.5 inch
    Nominal Media Rotation Rate: 5900
Capabilities:
    LBA, IORDY(can be disabled)
    Queue depth: 32
    Standby timer values: spec'd by Standard, no device specific minimum
    R/W multiple sector transfer: Max = 16  Current = ?
    Advanced power management level: 128
    Recommended acoustic management value: 208, current value: 0
    DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
         Cycle time: min=120ns recommended=120ns
    PIO: pio0 pio1 pio2 pio3 pio4 
         Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
    Enabled Supported:
       *    SMART feature set
            Security Mode feature set
       *    Power Management feature set
       *    Write cache
       *    Look-ahead
       *    Host Protected Area feature set
       *    WRITE_BUFFER command
       *    READ_BUFFER command
       *    DOWNLOAD_MICROCODE
       *    Advanced Power Management feature set
            Power-Up In Standby feature set
       *    SET_FEATURES required to spinup after power up
            SET_MAX security extension
       *    48-bit Address feature set
       *    Device Configuration Overlay feature set
       *    Mandatory FLUSH_CACHE
       *    FLUSH_CACHE_EXT
       *    SMART error logging
       *    SMART self-test
       *    General Purpose Logging feature set
       *    WRITE_{DMA|MULTIPLE}_FUA_EXT
       *    64-bit World wide name
            Write-Read-Verify feature set
       *    WRITE_UNCORRECTABLE_EXT command
       *    {READ,WRITE}_DMA_EXT_GPL commands
       *    Segmented DOWNLOAD_MICROCODE
       *    Gen1 signaling speed (1.5Gb/s)
       *    Gen2 signaling speed (3.0Gb/s)
       *    Gen3 signaling speed (6.0Gb/s)
       *    Native Command Queueing (NCQ)
       *    Phy event counters
       *    unknown 76[15]
            DMA Setup Auto-Activate optimization
            Device-initiated interface power management
       *    Software settings preservation
       *    SMART Command Transport (SCT) feature set
       *    SCT LBA Segment Access (AC2)
            unknown 206[7]
            unknown 206[12] (vendor specific)
Security: 
    Master password revision code = 65534
        supported
    not enabled
    not locked
    not frozen
    not expired: security count
        supported: enhanced erase
    508min for SECURITY ERASE UNIT. 508min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000c500651cc162
    NAA     : 5
    IEEE OUI    : 000c50
    Unique ID   : 0651cc162
Checksum: correct


desinfect@desinfect:/dev$ sudo fdisk -l /dev/sdb

Warnung: GPT (GUID-Partitionstabelle) auf '/dev/sdb' erkannt! Das Hilfsprogramm Fdisk unterstützt GPT nicht. Verwenden Sie GNU Parted.


Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes
255 Köpfe, 63 Sektoren/Spur, 486401 Zylinder, zusammen 7814037168 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x7453181c

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT

O disco rígido tem GPT. O gparted mostra uma área não particionada de 4 MB e o restante de 3,6 TB é usado para uma partição ext4. parted mostra como:

$ parted --list

Modell: ST4000DM 000-1F2168 (scsi)
Festplatte  /dev/sdb:  4001GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: gpt

Nummer  Anfang  Ende    Größe   Dateisystem  Name   Flags
 1      4194kB  4001GB  4001GB  ext4         linux

O NAS usa discos rígidos 2x 4 TB que são espelhados usando o mdraid. Eu me pergunto por que o NAS não tem problema em usá-los ...

    
por Daniel Marschall 17.08.2014 / 23:35

1 resposta

1

Você não pode fazer fdisk porque você já está com o dobro do máximo da MBR com um dispositivo de 4TB em setores de 512b. Você precisa formatá-lo com o GPT.

De wikipedia :

The organization of the partition table in the MBR limits the maximum addressable storage space of a disk to 2 TB (232 × 512 bytes).

Pegue o pacote gdisk e reformate o disco (embora pareça que já deveria estar) . Se você estiver olhando para esse disco a partir de uma máquina que não pode montar um disco GPT, o MBR de proteção explicaria o erro hdparm .

Senão eu vejo que o tamanho do setor físico está listado em 4kb - o que faz um pouco mais de sentido - e torna a MBR viável, mas, como você viu, é bastante difícil de manejar. A solução vai estar em uma tabela de partição atualizada.

Mais de wikipedia

Since partitioning information is stored in the MBR partition table using a beginning block address and a length, it may in theory be possible to define partitions in such a way that the allocated space for a disk with 512-byte sectors gives a total size approaching 4 TB, if all but one partition are located below the 2 TB limit and the last one is assigned as starting at or close to block 232−1 and specify the size as up to 232−1, thereby defining a partition which requires 33 rather than 32 bits for the sector address to be accessed. However, in practice, only certain LBA-48 enabled operating systems, including Linux, FreeBSD and Windows 7 that use 64-bit sector addresses internally actually support this.

Due to code space constraints and the nature of the MBR partition table to only support 32 bits, boot sectors, even if enabled to support LBA-48 rather than LBA-28, often use 32-bit calculations, unless they are specifically designed to support the full address range of LBA-48 or are intended to run on 64-bit platforms only. Any boot code or operating system using 32-bit sector addresses internally would cause addresses to wrap around accessing this partition and thereby result in serious data corruption over all partitions.

For disks that present a sector size other than 512 bytes, such as USB external drives, there are limitations as well. A sector size of 4,096 results in an eight-fold increase in the size of a partition that can be defined using MBR, allowing partitions up to 16 TiB (232 × 4096 bytes) in size. Versions of Windows more recent than Windows XP support the larger sector sizes as well as Mac OS X, and the Linux kernel has supported larger sector sizes since 2.6.31 or 2.6.32, but issues with boot loaders, partitioning tools and computer BIOS implementations present certain limitations, since they are often hard-wired to reserve only 512 bytes for sector buffers, causing memory to become overwritten for larger sector sizes. This may cause unpredictable behaviour as well, and therefore should be avoided when compatibility and standard conformity is an issue.

Há um link para um Western Digital .pdf discutindo a possibilidade de usar tamanhos de setor MBR maiores em drives muito grandes. Aparentemente, o kernel 2.6.32 foi o primeiro a introduzir suporte para esse recurso. Eu não sei se é uma opção de tempo de compilação ou não, mas talvez seja muito novo quando o seu próprio kernel NAS foi construído.

Aparentemente, existem outras possibilidades. A partir do .pdf

Older Linux Kernel version (all 2.4 and pre‐2.6.32) computing 
environments with a legacy BIOS and MBR partition table scheme 
encounter a barrier at 2.19 TB because they can address only up 
to 232 logical blocks. Be sure to use kernels that contain support 
for drives greater than 2.19TB.  The kernels released after April 
2010 have support for large capacity drives using 4096 sector sizes.

...

How You Can Take Advantage of Large Capacity Drives in Linux
• Use fdisk from util‐linux‐ng >= 2.17.2 or parted/gparted   
• Use +size {M, G} convention to specify "Last sector" 
  (e.g. +5G to create 5GiB partition) then fdiskl aligns the 
  size to physical block boundary  
• Remember that fdisk(8) always follows your wishes ‐‐ it means 
  that if you explicitly define first/last sector number then 
  the partition could be misaligned.
• Start the extended partition at sector 64 (the default is 63), 
  and end it at sector (total amount of sectors on the drive – 1)
    
por 18.08.2014 / 00:42