Záloha metadat/Kychot/ADATA SDHC CARD 155X CLASS10 - 16GB
Záloha metadat/Kychot/ADATA SDHC CARD 155X CLASS10 - 16GB
Intro
editovatUž se mi stalo nedávno (Záloha metadat/Kychot/GoFlex), že jsem koupil nějakou externí paměť a příkaz cfdisk mi odmítnul zobrazit tabulku jejího rozdělení – a nyní se to opakuje opět. Hned po vybalení karty z originálního obalu a zasunutí do slotu:
/var/log/kern.log
Jan 5 09:46:49 mi kernel: [12090.949376] sd 2:0:0:0: [sdb] 31537152 512-byte logical blocks: (16.1 GB/15.0 GiB) Jan 5 09:46:49 mi kernel: [12090.950218] sd 2:0:0:0: [sdb] Assuming drive cache: write through Jan 5 09:46:49 mi kernel: [12090.951963] sd 2:0:0:0: [sdb] Assuming drive cache: write through Jan 5 09:46:49 mi kernel: [12090.951981] sdb: sdb1
cfdisk /dev/sdb
OSUDOVÁ CHYBA: Chybný primární diskový oddíl 0: Diskový oddíl končí v posledním částečném cylindru Stiskněte jakoukoliv klávesu pro ukončení programu cfdisk
Otázka zní, co je kde špatně? Vypadá to, že výrobci začali formátovat karty nějakým divným způsobem, možná zase na popud nějakých M$Win?
sfdisk
editovat- sfdisk -lV /dev/sdb
Disk /dev/sdb: cylindrů: 15399, hlav: 64, sektorů/stopu: 32 Varování: Zdá se, že tabulka rozdělení disku byla vytvořena pro C/H/S=*/25/45 (místo 15399/64/32). Zobrazuji za použití této geometrie. Jednotky = cylindry po 576000 bajtech, bloky po 1024 bajtech, počítáno od 0 Zařízení Boot Začátek Konec Cyldrů Bloků Id Systém /dev/sdb1 7+ 28033- 28026- 15764480 6 FAT16 začátek: (c,h,s) předpoklad (7,7,3) nalezeno (0,130,3) konec: (c,h,s) předpoklad (1023,24,45) nalezeno (939,24,45) /dev/sdb2 0 - 0 0 0 Prázdný prostor /dev/sdb3 0 - 0 0 0 Prázdný prostor /dev/sdb4 0 - 0 0 0 Prázdný prostor Varování: žádný primární diskový oddíl není označen jako startovací. LILU to nečiní problémy, ale DOS z tohoto disku nenastartuje. začátek diskového oddílu 1 má chybný počet hlav: 130 (mělo by být 0-63)
Geometrie, jak ji interpretuje jádro:
sfdisk -g /dev/sdb
/dev/sdb: 15399 cylindrů, 64 hlav, 32 sektorů/stopu
Geometrie, jak je uvedená partition table: sfdisk -G /dev/sdb
/dev/sdb: 28033 cylindrů, 25 hlav, 45 sektorů/stopu
sfdisk -d /dev/sdb
# partition table of /dev/sdb unit: sectors /dev/sdb1 : start= 8192, size= 31528960, Id= 6 /dev/sdb2 : start= 0, size= 0, Id= 0 /dev/sdb3 : start= 0, size= 0, Id= 0 /dev/sdb4 : start= 0, size= 0, Id= 0
fdisk
editovatfdisk /dev/sdb
POZOR: Režim kompatibility s DOSem je zastaralý. Důrazně se doporučuje tento režim vypnout (příkaz „c“) a změnit jednotky výpisů na sektory (příkaz „u“). Příkaz (m pro nápovědu): p Disk /dev/sdb: 16,1 GB, 16 147 021 824 bajtů hlav: 25, sektorů na stopu: 45, cylindrů: 28 033 Jednotky = cylindry po 1125 * 512 = 576 000 bajtech Velikost sektoru (logického/fyzického): 512 bajtů / 512 bajtů Velikost I/O (minimální/optimální): 512 bajtů / 512 bajtů Identifikátor disku: 0x00000000 Zařízení Zavádět Začátek Konec Bloky Id Systém /dev/sdb1 8 28034 15764480 6 FAT16 Příkaz (m pro nápovědu): u Měním jednotky v nichž jsou vypisovány informace na sektory Příkaz (m pro nápovědu): c Příznak DOSOVÉ kompatibility není nastaven. Příkaz (m pro nápovědu): p Disk /dev/sdb: 16,1 GB, 16 147 021 824 bajtů hlav: 25, sektorů na stopu: 45, cylindrů: 28 033, celkem 31 537 152 sektorů Jednotky = sektory po 1 * 512 = 512 bajtech Velikost sektoru (logického/fyzického): 512 bajtů / 512 bajtů Velikost I/O (minimální/optimální): 512 bajtů / 512 bajtů Identifikátor disku: 0x00000000 Zařízení Zavádět Začátek Konec Bloky Id Systém /dev/sdb1 8192 31537151 15764480 6 FAT16 Příkaz (m pro nápovědu): x Příkaz pro odborníky (m pro nápovědu): p Disk /dev/sdb: hlav: 25, sektorů: 45, cylindrů: 28 033 Č. AF Hd Sek Cyl Hd Sek Cyl Začátek Vel. Id 1 00 130 3 0 24 45 939 8192 31528960 06 2 00 0 0 0 0 0 0 0 0 00 3 00 0 0 0 0 0 0 0 0 00 4 00 0 0 0 0 0 0 0 0 00 Příkaz pro odborníky (m pro nápovědu): v Zbývá 8 191 nealokovaných 512bajtových sektorů Příkaz pro odborníky (m pro nápovědu): d Zařízení: /dev/sdb 0x000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 0x1C0: 03 00 06 18 ED AB 00 20 00 00 00 18 E1 01 00 00 0x1D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA
Co mě ještě trochu zaráží, že je nastaven souborový systém FAT16, o kterém se píše (w: FAT16), že funguje jen do 2 GB a toto je 16 GB karta.
dosfsck
editovat- dosfsck - check and repair MS-DOS file systems
- -n No-operation mode: non-interactively check for errors, but don't write anything to the filesystem.
- -v Verbose mode. Generates slightly more output.
dosfsck -n -v /dev/sdb1
dosfsck 3.0.7 (24 Dec 2009) dosfsck 3.0.7, 24 Dec 2009, FAT32, LFN Checking we can access the last sector of the filesystem Boot sector contents: System ID " " Media byte 0xf8 (hard disk) 512 bytes per logical sector 32768 bytes per cluster 496 reserved sectors First FAT starts at byte 253952 (sector 496) 2 FATs, 32 bit entries 1970176 bytes per FAT (= 3848 sectors) Root directory start at cluster 2 (arbitrary size) Data area starts at byte 4194304 (sector 8192) 492512 data clusters (16138633216 bytes) 63 sectors/track, 255 heads 8192 hidden sectors 31528960 sectors total Checking for unused clusters. Checking free cluster summary. Free cluster summary uninitialized (should be 492511) Auto-setting. Leaving file system unchanged. /dev/sdb1: 0 files, 1/492512 clusters
mtools
editovatViz http://www.gnu.org/software/mtools/manual/mtools.html
Jako root:
~/.mtoolsrc
drive d: file="/dev/sdb1"
minfo -v d:
device information: =================== filename="/dev/sdb1" sectors per track: 63 heads: 255 cylinders: 1963 mformat command line: mformat -t 1963 -h 255 -s 63 -H 8192 d: bootsector information ====================== banner:" " sector size: 512 bytes cluster size: 64 sectors reserved (boot) sectors: 496 fats: 2 max available root directory slots: 0 small size: 0 sectors media descriptor byte: 0xf8 sectors per fat: 0 sectors per track: 63 heads: 255 hidden sectors: 8192 big size: 31528960 sectors physical drive id: 0x80 reserved=0x0 dos4=0x29 serial number: 00000000 disk label=" " disk type="FAT32 " Big fatlen=3848 Extended flags=0x0000 FS version=0x0000 rootCluster=2 infoSector location=1 backup boot sector=6 Infosector: signature=0x41615252 Boot sector hexdump: 000 eb 00 90 20 20 20 20 20 20 20 20 00 02 40 f0 01 ... ..@.. 010 02 00 00 00 00 f8 00 00 3f 00 ff 00 00 20 00 00 ........?.... .. 020 00 18 e1 01 08 0f 00 00 00 00 00 00 02 00 00 00 ................ 030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040 80 00 29 00 00 00 00 20 20 20 20 20 20 20 20 20 ..).... 050 20 20 46 41 54 33 32 20 20 20 00 00 00 00 00 00 FAT32 ...... 060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 1a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 1b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 1c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 1d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 1e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 1f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa ..............U.
automounter
editovatNakonec necháme systém souboru automaticky přimountovat a podíváme se, co to udělá:
mount
/dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)
df -h
Souborový systém Velik Užito Volno Uži% Mounted on /dev/sdb1 16G 32K 16G 1% /media/disk
df
Souborový systém 1K bloků Použité Volné Uži% Mounted on /dev/sdb1 15760384 32 15760352 1% /media/disk
Závěr
editovat- V partition table je jako typ filesystému uveden FAT16, zatímco ve skutečnosti se jedná o FAT32, montuje se jako vfat
- To ještě nevysvětluje, proč to neotevře fdisk
Po vložení karty do fotoaparátu je pro něj (zdá se) okamžitě použitelná bez nutnosti přeformátování. Ukazuje volných:
- 5352 snímků v nejvyšším rozlišení