LINUX.ORG.RU

Не монтируется rootfs с некоторых sd-карт

 ,


0

2

Вводные данные

Есть образ для sd:

$ gdisk -l sdcard.img
GPT fdisk (gdisk) version 1.0.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk sdcard.img: 1105960 sectors, 540.0 MiB
Sector size (logical): 512 bytes
Disk identifier (GUID): B00D8182-4B3E-46AB-A778-EA132328E92D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1105926
Partitions will be aligned on 2048-sector boundaries
Total free space is 16357 sectors (8.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1           16384           24575   4.0 MiB     8300  uboot
   2           24576           32767   4.0 MiB     8300  misc
   3           32768          163839   64.0 MiB    8300  boot
   4          163840          425983   128.0 MiB   8300  recovery
   5          425984          491519   32.0 MiB    8300  backup
   6          491520         1105919   300.0 MiB   8300  rootfs

Заливаю следующим образом:

$ dd if=sdcard.img of=/dev/sdc bs=1M status=progress && sync

С некоторыми sd всё замечательно. После dd сразу можно сделать:

# mount /dev/sdc6 mnt/

И всё работает. А с другими какая-то фигня. sd-карты разных размеров: 8, 16, 32 гб.

Какая-то фигня

Другие sd-карты. Делаю всё также dd (можно предварительно if=/dev/zero для надёжности).

Если воткнуть в устройство

Устройство запускается uboot и kernel запускаются. Но потом случается kernel panic:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,6)

Если попробовать примонтировать

[173705.740640] EXT4-fs (sdc6): VFS: Can't find ext4 filesystem
[173705.741159] EXT4-fs (sdc6): VFS: Can't find ext4 filesystem
[173705.741470] EXT4-fs (sdc6): VFS: Can't find ext4 filesystem
[173705.759537] ISOFS: Unable to identify CD-ROM format.
[173705.759835] FAT-fs (sdc6): bogus number of reserved sectors
[173705.759837] FAT-fs (sdc6): Can't find a valid FAT filesystem
[173705.760256] hfs: can't find a HFS filesystem on dev sdc6
[173705.760632] hfsplus: unable to find HFS+ superblock
[173705.761486] exFAT-fs (sdc6): invalid boot record signature
[173705.761488] exFAT-fs (sdc6): failed to read boot sector
[173705.761489] exFAT-fs (sdc6): failed to recognize exfat type

А что говорит gdisk?

Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.

Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Command (? for help): v

Caution: The CRC for the backup partition table is invalid. This table may
be corrupt. This program will automatically create a new backup partition
table when you save your partitions.

Identified 1 problems!

Откуда эти проблемы берутся? Как их лечить?

Коллега говорит, что не пожмотился и взял подороже. Теперь очень расстроен.

Если взять карточку новую из коробки, она работает. Если gdisk’ом заново разметить диск, он это сделает без каких-либо ошибок, но при повторном запуске будет это:

Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.

Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

Jullyfish ★★
() автор топика
# f3probe --destructive --time-ops /dev/sdc 
F3 probe 8.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

WARNING: Probing normally takes from a few seconds to 15 minutes, but
         it can take longer. Please be patient.

Bad news: The device `/dev/sdc' is a counterfeit of type limbo

You can "fix" this device using the following command:
f3fix --last-sec=244223 /dev/sdc

Device geometry:
	         *Usable* size: 119.25 MB (244224 blocks)
	        Announced size: 15.43 GB (32358400 blocks)
	                Module: 16.00 GB (2^34 Bytes)
	Approximate cache size: 0.00 Byte (0 blocks), need-reset=no
	   Physical block size: 512.00 Byte (2^9 Bytes)

Probe time: 3.22s
 Operation: total time / count = avg time
      Read: 113.9ms / 2150 = 52us
     Write: 3.10s / 2148 = 1.4ms
     Reset: 0us / 0 = 0us
Jullyfish ★★
() автор топика
Ответ на: комментарий от Jullyfish

SD-контроллеры, встроенные в чип/материнскую плату. Наверное, pci-e-контроллеры тоже подходят. Иными словами, отсутствие эмуляции USB Mass Storage.

ValdikSS ★★★★★
()
Ответ на: комментарий от ValdikSS

Как тут выяснилось, у ноутбука «встроенный» sd-разъём тоже через usb подключен.

Jullyfish ★★
() автор топика
Ответ на: комментарий от Jullyfish

Теперь очень расстроен.

Ну продавцу набить морду. КМК флэшки - та хрень, которую желательно в магазине покупать реале, чтобы потом можно было в морду плюнуть.

lonelywoolf
()
  • Markdown
Пустая строка (два раза Enter) начинает новый абзац. Знак '>' в начале абзаца выделяет абзац курсивом цитирования.
Внимание: прочитайте описание разметки Markdown.
Используйте Ctrl-Enter для размещения комментария