Impossible de formater ma carte SD

Le problème exposé dans ce sujet a été résolu.

Bonjour,

J'ai une carte SD PNY 8G que j'utilise pour ma Raspberry. Suite à quelques déboires (kernel panic : no init found), j'ai décidé de tout reprendre à zéro, de la formater et de réinstaller un OS. Seulement, sous Windows, il me dit que c'est impossible et sous Linux, tout semble fonctionner mais quand je la monte, je retrouve mes fichiers. De même si je les supprime à la main, que je démonte la carte puis la remonte. De même si je modifie un fichier, démonte la carte et la remonte.

Merci. =)

+0 -0

Salut !

Beaucoup de carte SD (toutes ?) ont une encoche sur le rebord afin de la passer en lecture seule, ça ne viendrait pas de là ?
J'aurais tendance à penser que mkfs devrait t'envoyer balader explicitement, mais vu qu'il t'es impossible sous windows ; dans le doute…

J'ai déjà vérifié l'encoche. ^^

Pour information, quand je branche ma carte SD à mon Fedora, deux partitions sont montées : "boot" et "7.9 GB Volume". Je les démonte toutes les deux. Puis :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[root@localhost ~]# mkfs -t ext3 /dev/sdc1
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
14336 inodes, 57344 blocks
2867 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=58720256
7 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
    8193, 24577, 40961

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

[root@localhost ~]# mkfs -t ext3 /dev/sdc2
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
482384 inodes, 1929216 blocks
96460 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1975517184
59 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): mkfs.ext3: File exists 
    while trying to create journal
[root@localhost ~]#

Dans mon File Manager, j'ai à présent "59MB Volume" et "7.9GB Volume". Quand je veut monter le premier, j'obtiens :

Error mounting /dev/sdc1 at /run/media/vincent/66b8122e-9627-413b-ad64-ffdf36505de1: Command-line `mount -t "ext3" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdc1" "/run/media/vincent/66b8122e-9627-413b-ad64-ffdf36505de1"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error

1
2
   In some cases useful info is found in syslog - try
   dmesg | tail or so.

Quand je monte le second, je tombe sur les fichiers qu'il y avait avant !

Merci. ^^

+0 -0

En insérant la carte, je me suis retrouvé avec deux partitions : "boot" et "7.9GB Volume", contenant les fichiers de Raspbian. Donc je n'ai plus le message d'erreur à la lecture de la partition. Il a retrouvé les fichiers…

J'ignore si ça peut résulter de cela, mais via raspi-config, à l'époque où ça fonctionnait encore, j'ai fait Expand filesystem. En fait, j'ai suivi ces instructions, et c'est au reboot que ça a merdé.

Bref. J'obtiens cela :

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
[root@localhost vincent]# mount
...
/dev/sdb1 on /run/media/vincent/boot type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
/dev/sdb2 on /run/media/vincent/3d81d9e2-7d1b-4015-8c2c-29ec0875f762 type ext4 (rw,nosuid,nodev,relatime,seclabel,user_xattr,barrier=1,data=ordered,uhelper=udisks2)



[root@localhost vincent]# mkfs -t ext3 /dev/sdb1
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
14336 inodes, 57344 blocks
2867 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=58720256
7 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
    8193, 24577, 40961

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done



[root@localhost vincent]# mkfs -t ext3 /dev/sdb2
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
482384 inodes, 1929216 blocks
96460 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1975517184
59 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): mkfs.ext3: File exists 
    while trying to create journal



[root@localhost vincent]# fdisk -l

...

Disk /dev/sdb: 7.4 GiB, 7964983296 bytes, 15556608 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
Disklabel type: dos
Disk identifier: 0x00090806

Device    Boot     Start       End  Blocks  Id System
/dev/sdb1           8192    122879   57344   c W95 FAT32 (LBA)
/dev/sdb2         122880  15556607 7716864  83 Linux



[root@localhost vincent]# Essai de montage...
Montage réussi !
Oh ! Je retrouve mes fichiers ! 
Formatage échoué...


[root@localhost vincent]# dmesg | tail -n 150
[   11.160564] systemd[1]: Starting Remote File Systems.
[   11.160787] systemd[1]: Reached target Remote File Systems.
[   11.160840] systemd[1]: Starting Delayed Shutdown Socket.
[   11.165359] systemd[1]: Listening on Delayed Shutdown Socket.
[   11.165456] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[   11.166443] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[   11.166488] systemd[1]: Starting Device-mapper event daemon FIFOs.
[   11.168315] systemd[1]: Listening on Device-mapper event daemon FIFOs.
[   11.168586] systemd[1]: Starting Arbitrary Executable File Formats File System Automount Point.
[   11.170099] SELinux: initialized (dev autofs, type autofs), uses genfs_contexts
[   11.170845] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[   11.170936] systemd[1]: Starting Encrypted Volumes.
[   11.171139] systemd[1]: Reached target Encrypted Volumes.
[   11.171216] systemd[1]: Starting Journal Socket.
[   11.176174] systemd[1]: Listening on Journal Socket.
[   11.176362] systemd[1]: Mounting Debug File System...
[   11.219673] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[   11.221459] systemd[1]: Starting Journal Service...
[   11.224893] systemd[1]: Started Journal Service.
[   11.798588] SELinux: initialized (dev hugetlbfs, type hugetlbfs), uses transition SIDs
[   11.813388] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[   12.131068] systemd-journald[320]: Vacuuming done, freed 0 bytes
[   12.279381] SELinux: initialized (dev configfs, type configfs), uses genfs_contexts
[   12.972359] systemd-udevd[349]: starting version 208
[   13.224393] EXT4-fs (dm-1): re-mounted. Opts: (null)
[   14.750090] parport_pc 00:0a: reported by Plug and Play ACPI
[   14.750146] parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE]
[   14.784669] intel_rng: FWH not detected
[   14.787828] via_rhine: v1.10-LK1.5.0 2010-10-09 Written by Donald Becker
[   14.787886] via-rhine 0000:03:0f.0: enabling device (0000 -> 0003)
[   14.807271] iTCO_vendor_support: vendor-support=0
[   14.816178] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.07
[   14.816311] iTCO_wdt: Found a ICH4 TCO device (Version=1, TCOBASE=0x0860)
[   14.825115] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
[   14.843383] via-rhine 0000:03:0f.0: eth0: VIA Rhine at 0xdfdf8000, 00:50:ba:a9:cb:41, IRQ 18
[   14.849580] via-rhine 0000:03:0f.0: eth0: MII PHY found at address 8, status 0x782d advertising 05e1 Link 45e1
[   14.925110] ssb: Core 0 found: Fast Ethernet (cc 0x806, rev 0x04, vendor 0x4243)
[   14.925119] ssb: Core 1 found: V90 (cc 0x807, rev 0x01, vendor 0x4243)
[   14.925127] ssb: Core 2 found: PCI (cc 0x804, rev 0x02, vendor 0x4243)
[   14.945206] ssb: Sonics Silicon Backplane found on PCI device 0000:03:0a.0
[   14.945242] b44: Broadcom 44xx/47xx 10/100 PCI ethernet driver version 2.0
[   14.953811] b44 ssb0:0: eth1: Broadcom 44xx/47xx 10/100 PCI ethernet driver 00:0f:fe:04:82:a6
[   15.167549] ppdev: user-space parallel port driver
[   15.236539] snd_intel8x0 0000:00:1f.5: setting latency timer to 64
[   15.270651] systemd-udevd[363]: renamed network interface eth0 to p3p1
[   15.368581] systemd-udevd[366]: renamed network interface eth1 to em1
[   15.651032] intel8x0_measure_ac97_clock: measured 50753 usecs (2446 samples)
[   15.651039] intel8x0: clocking to 48000
[   16.165303] Adding 1015804k swap on /dev/mapper/vg_vincent-lv_swap.  Priority:-1 extents:1 across:1015804k 
[   19.020990] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   19.313797] SELinux: initialized (dev sda1, type ext4), uses xattr
[   19.398962] systemd-journald[320]: Received request to flush runtime journal from PID 1
[   19.789105] type=1305 audit(1413950976.525:4): audit_pid=418 old=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1
[   20.471138] systemd-journald[320]: File /var/log/journal/1f041bca5af44d71be9a5d265aa232c9/system.journal corrupted or uncleanly shut down, renaming and replacing.
[   22.508759] nf_conntrack version 0.5.0 (7829 buckets, 31316 max)
[   24.784611] netlink: 20 bytes leftover after parsing attributes.
[   24.784622] netlink: 20 bytes leftover after parsing attributes.
[   24.784689] netlink: 20 bytes leftover after parsing attributes.
[   24.855418] netlink: 20 bytes leftover after parsing attributes.
[   24.855427] netlink: 20 bytes leftover after parsing attributes.
[   24.855490] netlink: 20 bytes leftover after parsing attributes.
[   24.963932] netlink: 20 bytes leftover after parsing attributes.
[   24.963943] netlink: 20 bytes leftover after parsing attributes.
[   24.964315] netlink: 20 bytes leftover after parsing attributes.
[   25.507981] netlink: 20 bytes leftover after parsing attributes.
[   25.507991] netlink: 20 bytes leftover after parsing attributes.
[   25.508375] netlink: 20 bytes leftover after parsing attributes.
[   27.762443] netlink: 20 bytes leftover after parsing attributes.
[   27.762453] netlink: 20 bytes leftover after parsing attributes.
[   27.762532] netlink: 20 bytes leftover after parsing attributes.
[   27.803963] netlink: 20 bytes leftover after parsing attributes.
[   27.803972] netlink: 20 bytes leftover after parsing attributes.
[   27.809171] netlink: 20 bytes leftover after parsing attributes.
[   35.938016] p3p1: no IPv6 routers present
[   38.761923] systemd-journald[320]: File /var/log/journal/1f041bca5af44d71be9a5d265aa232c9/user-42.journal corrupted or uncleanly shut down, renaming and replacing.
[   89.294968] [drm] capturing error event; look for more information in /debug/dri/0/i915_error_state
[   89.295015] render error detected, EIR: 0x00000010
[   89.295015] [drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
[   89.295015] render error detected, EIR: 0x00000010
[   96.627913] systemd-journald[320]: File /var/log/journal/1f041bca5af44d71be9a5d265aa232c9/user-1000.journal corrupted or uncleanly shut down, renaming and replacing.
[  105.638859] fuse init (API version 7.18)
[  105.692997] SELinux: initialized (dev fuse, type fuse), uses genfs_contexts
[  105.733467] SELinux: initialized (dev fusectl, type fusectl), uses genfs_contexts
[  221.438043] usb 1-4: new high-speed USB device number 3 using ehci_hcd
[  221.554360] usb 1-4: New USB device found, idVendor=058f, idProduct=6335
[  221.554367] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  221.554370] usb 1-4: Product: Mass Storage Device
[  221.554373] usb 1-4: Manufacturer: Generic
[  221.554376] usb 1-4: SerialNumber: 058F011111B1
[  222.922173] Initializing USB Mass Storage driver...
[  222.925206] scsi2 : usb-storage 1-4:1.0
[  222.925391] usbcore: registered new interface driver usb-storage
[  222.925395] USB Mass Storage support registered.
[  223.930380] scsi 2:0:0:0: Direct-Access     SD/MMC   Card  Reader     1.00 PQ: 0 ANSI: 0
[  223.940530] sd 2:0:0:0: Attached scsi generic sg1 type 0
[  223.943634] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[  232.966844] sd 2:0:0:0: [sdb] 15556608 512-byte logical blocks: (7.96 GB/7.41 GiB)
[  232.970832] sd 2:0:0:0: [sdb] No Caching mode page present
[  232.970838] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[  232.978465] sd 2:0:0:0: [sdb] No Caching mode page present
[  232.978473] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[  232.982302]  sdb: sdb1 sdb2
[  233.137077] sd 2:0:0:0: [sdb] Media Changed
[  233.137085] sd 2:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  233.137090] sd 2:0:0:0: [sdb]  Sense Key : Unit Attention [current] 
[  233.137096] Info fld=0x0
[  233.137099] sd 2:0:0:0: [sdb]  Add. Sense: Not ready to ready change, medium may have changed
[  233.137107] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 ed 5f f8 00 00 01 00
[  233.137118] end_request: I/O error, dev sdb, sector 15556600
[  233.137127] Buffer I/O error on device sdb, logical block 1944575
[  233.152806] sd 2:0:0:0: [sdb] No Caching mode page present
[  233.152815] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[  233.160176] sd 2:0:0:0: [sdb] No Caching mode page present
[  233.160183] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[  233.164059]  sdb: sdb1 sdb2
[  234.590583] SELinux: initialized (dev sdb1, type vfat), uses genfs_contexts
[  235.654751] EXT4-fs (sdb2): ext4_orphan_cleanup: deleting unreferenced inode 15287
[  235.658522] EXT4-fs (sdb2): 1 orphan inode deleted
[  235.658528] EXT4-fs (sdb2): recovery complete
[  235.692116] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
[  235.692144] SELinux: initialized (dev sdb2, type ext4), uses xattr
[  375.546429] SELinux: initialized (dev sdb1, type vfat), uses genfs_contexts
[  378.559266] EXT4-fs (sdb2): ext4_orphan_cleanup: deleting unreferenced inode 15287
[  378.563891] EXT4-fs (sdb2): 1 orphan inode deleted
[  378.563896] EXT4-fs (sdb2): recovery complete
[  378.597462] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
[  378.597490] SELinux: initialized (dev sdb2, type ext4), uses xattr
[  958.241261] SELinux: initialized (dev sdb1, type vfat), uses genfs_contexts
[  964.244461] EXT4-fs (sdb2): ext4_orphan_cleanup: deleting unreferenced inode 15287
[  964.249107] EXT4-fs (sdb2): 1 orphan inode deleted
[  964.249113] EXT4-fs (sdb2): recovery complete
[  964.282105] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
[  964.282132] SELinux: initialized (dev sdb2, type ext4), uses xattr
[ 1012.425184] sd 2:0:0:0: [sdb] No Caching mode page present
[ 1012.425193] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 1066.995410] sd 2:0:0:0: [sdb] No Caching mode page present
[ 1066.995420] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 1066.999322]  sdb: sdb1 sdb2
[ 1067.082522] SELinux: initialized (dev sdb1, type vfat), uses genfs_contexts
[ 1073.996486] EXT4-fs (sdb2): ext4_orphan_cleanup: deleting unreferenced inode 15287
[ 1074.001155] EXT4-fs (sdb2): 1 orphan inode deleted
[ 1074.001161] EXT4-fs (sdb2): recovery complete
[ 1074.034155] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
[ 1074.034181] SELinux: initialized (dev sdb2, type ext4), uses xattr
[ 1123.851484] SELinux: initialized (dev sdb1, type vfat), uses genfs_contexts
[ 1125.763975] EXT4-fs (sdb2): ext4_orphan_cleanup: deleting unreferenced inode 15287
[ 1125.768741] EXT4-fs (sdb2): 1 orphan inode deleted
[ 1125.768748] EXT4-fs (sdb2): recovery complete
[ 1125.803512] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
[ 1125.803539] SELinux: initialized (dev sdb2, type ext4), uses xattr



[root@localhost vincent]# 

Merci. =)

+0 -0

Bon, alors, progressons par points:

1
2
3
4
[   89.294968] [drm] capturing error event; look for more information in /debug/dri/0/i915_error_state
[   89.295015] render error detected, EIR: 0x00000010
[   89.295015] [drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
[   89.295015] render error detected, EIR: 0x00000010

C'est complètement HS, mais tant qu'on y est : visiblement il a un petit soucis avec ton IGP (= carte graphique intégrée), et au cas où tu te poserais la question, ce n'est absolument pas critique : si ton affichage marche, tout va bien (c'est peut-être une erreur sur une instruction d'initialisation ou un truc du genre, enfin dans tout les cas osef, ce n'est pas la peine de t'en occupper)

1
2
3
4
5
6
7
8
[  233.137077] sd 2:0:0:0: [sdb] Media Changed
[  233.137085] sd 2:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  233.137090] sd 2:0:0:0: [sdb]  Sense Key : Unit Attention [current] 
[  233.137096] Info fld=0x0
[  233.137099] sd 2:0:0:0: [sdb]  Add. Sense: Not ready to ready change, medium may have changed
[  233.137107] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 ed 5f f8 00 00 01 00
[  233.137118] end_request: I/O error, dev sdb, sector 15556600
[  233.137127] Buffer I/O error on device sdb, logical block 1944575

Je crois que le problème est ici. Le reste semble appartenir aux montages des partoches.

Bon, de ce que je crois comprendre (mais je suis peut-être en train de me planter complètement), ceci:

1
2
3
4
5
[  233.137077] sd 2:0:0:0: [sdb] Media Changed
[  233.137085] sd 2:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  233.137090] sd 2:0:0:0: [sdb]  Sense Key : Unit Attention [current] 
[  233.137096] Info fld=0x0
[  233.137099] sd 2:0:0:0: [sdb]  Add. Sense: Not ready to ready change, medium may have changed

serait pour signaler le prob matériel (ou alors tout bêtement parce qu'on est sur un adaptateur MMC/usb, du coup les choses se font un peu en décalées), et ceci :

1
2
3
[  233.137107] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 ed 5f f8 00 00 01 00
[  233.137118] end_request: I/O error, dev sdb, sector 15556600
[  233.137127] Buffer I/O error on device sdb, logical block 1944575

pour le formatage. Je serais tenté de te dire ceci:

  • end_request: I/O error, dev sdb, sector 15556600 pour le formatage de la partoche (si tu regardes, on est à la fin des secteurs de sdb2)
  • Buffer I/O error on device sdb, logical block 1944575 pour fdisk. Mais alors là, on est en plein dans la partition, et je ne vois pas du tout à quoi ça correspond.

Bref, si je devais extrapoler pour expliquer ce qui se passe (mais là j'ai vraiment 99% de chances de me planter), je dirais ceci:

  • dû à une partition (ou une table de) bizarre ou un problème matériel, sdb2 est inutilisable en écriture
  • du coup, mkfs sur sdb2 ne fait rien, ou plutôt les changements qu'il fait ne sont pas écrit sur la SD
  • tu as donc un fs inchangé

Tu as le même problème pour sdb1 ? (parce que pour sdb1, il a quand même viré le label)

Bon, le machin étant bizarre, je propose de virer la table des partoches, dans le doute, et de voir ce qui se passe en reformatant tout. Au fait, en reformatant, utilise plutôt fdisk directement, il sera peut-être plus verbeux que mkfs.

Bonne soirée !

+0 -0

Bon, le machin étant bizarre, je propose de virer la table des partoches, dans le doute, et de voir ce qui se passe en reformatant tout. Au fait, en reformatant, utilise plutôt fdisk directement, il sera peut-être plus verbeux que mkfs.

Bonne soirée !

dosmpm

fdisk et mkfs sont deux outils qui accomplissent des taches différentes. fdisk écrit la table de partitions dans le MBR (il existe gdisk pour gérer les GPT), mkfs écrit les structures de données d'un systeme de fichier dans une partition existante.

Il existe des softs qui font les deux à la fois, je crois que c'est le cas de parted.

L'idée de réécrire le MBR me semble bonne.

Merci ! =)

Pour sdb1 :

  • Je mets la carte ;
  • Deux partitions dans le FileManager : boot et 7.9GB Volume ;
  • Je les démonte ;
  • Je formate sdb1 (boot) :
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@localhost vincent]# mkfs.ext3 /dev/sdb1
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
14336 inodes, 57344 blocks
2867 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=58720256
7 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
    8193, 24577, 40961

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

[root@localhost vincent]# 
  • Je remonte boot et retrouve mes fichiers.

Pour sdb2 :

  • Je démonte 7.9GB Bolume ;
  • Je formate sdb2 :
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
[root@localhost vincent]# mkfs.ext3 /dev/sdb2
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
482384 inodes, 1929216 blocks
96460 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1975517184
59 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): mkfs.ext3: File exists 
    while trying to create journal
[root@localhost vincent]# 
  • Je le remonte ;
  • J'obtiens :

Error mounting /dev/sdb2 at /run/media/vincent/3d81d9e2-7d1b-4015-8c2c-29ec0875f762: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb2" "/run/media/vincent/3d81d9e2-7d1b-4015-8c2c-29ec0875f762"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sdb2, missing codepage or helper program, or other error

1
2
   In some cases useful info is found in syslog - try
   dmesg | tail or so.
  • J'effectue ce qu'il me dit :
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[root@localhost vincent]# dmesg | tail
[ 2633.495300] sd 2:0:0:0: [sdb] No Caching mode page present
[ 2633.495309] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 2633.504047] sd 2:0:0:0: [sdb] No Caching mode page present
[ 2633.504056] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 2633.508666]  sdb: sdb1 sdb2
[ 2675.836979] sd 2:0:0:0: [sdb] No Caching mode page present
[ 2675.836987] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 2675.845727] sd 2:0:0:0: [sdb] No Caching mode page present
[ 2675.845734] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 2675.849466]  sdb: sdb1 sdb2
[root@localhost vincent]#
  • Je remonte la partition 7.9GB Volume ;
  • Je retrouve mes fichiers…

Vu que je suis un noob en ligne de commande, pour "voir ce qui se passe en reformatant tout", j'ai fait :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[root@localhost vincent]# mkfs.ext3 /dev/sdb
mke2fs 1.42.8 (20-Jun-2013)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
486720 inodes, 1944576 blocks
97228 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1992294400
60 block groups
32768 blocks per group, 32768 fragments per group
8112 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

[root@localhost vincent]# 

Dans mon FileManager, j'ai toujours mes deux partitions, et quand je les monte, je retrouve mes fichiers. Mais en utilisant mount, j'obtiens cela :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
[root@localhost vincent]# fdisk -l
...
Disk /dev/sdb: 7.4 GiB, 7964983296 bytes, 15556608 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
Disklabel type: dos
Disk identifier: 0x00090806

Device    Boot     Start       End  Blocks  Id System
/dev/sdb1           8192    122879   57344   c W95 FAT32 (LBA)
/dev/sdb2         122880  15556607 7716864  83 Linux

[root@localhost vincent]# mount /dev/sdb1
mount: can't find /dev/sdb1 in /etc/fstab
[root@localhost vincent]# mount /dev/sdb2
mount: can't find /dev/sdb2 in /etc/fstab
[root@localhost vincent]# 

Pour fdisk, je ne vois pas comment on formate. En outre, ça semble inefficace :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[root@localhost vincent]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.24).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): 

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[root@localhost vincent]# fdisk -l
...

Disk /dev/sdb: 7.4 GiB, 7964983296 bytes, 15556608 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
Disklabel type: dos
Disk identifier: 0x00090806

Device    Boot     Start       End  Blocks  Id System
/dev/sdb1           8192    122879   57344   c W95 FAT32 (LBA)
/dev/sdb2         122880  15556607 7716864  83 Linux

[root@localhost vincent]# J'ai toujours mes deux partitions.

De même si j'écris une nouvelle partition :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[root@localhost vincent]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.24).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): 

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n

Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-15556607, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-15556607, default 15556607): 

Created a new partition 1 of type 'Linux' and of size 7.4 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[root@localhost vincent]# fdisk -l
...

Disk /dev/sdb: 7.4 GiB, 7964983296 bytes, 15556608 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
Disklabel type: dos
Disk identifier: 0x00090806

Device    Boot     Start       End  Blocks  Id System
/dev/sdb1           8192    122879   57344   c W95 FAT32 (LBA)
/dev/sdb2         122880  15556607 7716864  83 Linux

[root@localhost vincent]# 

Ce n'est pas d'une importance cruciale vu que j'ai acquis une autre carte SD, mais j'aimerais quand même comprendre pourquoi ça me fait ça. ^^

Merci. =)

+0 -0

Ah ok je n'avais pas bien pigé pour sdb1. Petite précision : dmesg te crache les messages du noyau, donc à priori c'est là qu'on devrait voir s'il y a des ennuis matériels.

Ce qui pourrait être interessant, c'est ce que nous sort dmesg quand fdisk veut mettre le boxon (mais qu'il n'y arrive pas). Aussi, est-ce que tu voudrais bien faire la chose suivante :

1
2
3
4
$ dmesg > dmesg1.log
# fdisk /dev/sdb # là tu refait ce que tu as fait : supprimer les 2 partoches
$ dmesg > dmesg2.log
$ diff -u dmesg1.log dmesg2.log

qui fait en fait tout bêtement la chose suivante : isoler ce qui a été fait après le premier dmesg. Donc il faudrait poster ce que la dernière commande sort.

Bonne soirée !

+0 -0

J'obtiens cela :

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[vincent@localhost ~]$ dmesg > dmesg1.log
[vincent@localhost ~]$ sudo fdisk /dev/sdb
[sudo] password for vincent: 

Welcome to fdisk (util-linux 2.24).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): 

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[vincent@localhost ~]$ dmesg > dmesg2.log
[vincent@localhost ~]$ diff -u dmesg1.log dmesg2.log
--- dmesg1.log  2014-10-24 04:01:44.320842338 +0200
+++ dmesg2.log  2014-10-24 04:03:15.354837262 +0200
@@ -712,3 +712,94 @@
 [  544.963191] sd 2:0:0:0: [sdb] No Caching mode page present
 [  544.963200] sd 2:0:0:0: [sdb] Assuming drive cache: write through
 [  544.967074]  sdb: sdb1 sdb2
+[  548.475040] sd 2:0:0:0: [sdb] No Caching mode page present
+[  548.475050] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  548.485045] sd 2:0:0:0: [sdb] No Caching mode page present
+[  548.485054] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  548.488981]  sdb: sdb1 sdb2
+[  560.253767] sd 2:0:0:0: [sdb] No Caching mode page present
+[  560.253776] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  560.263019] sd 2:0:0:0: [sdb] No Caching mode page present
+[  560.263027] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  560.266870]  sdb: sdb1 sdb2
+[  564.478310] sd 2:0:0:0: [sdb] No Caching mode page present
+[  564.478318] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  564.485431] sd 2:0:0:0: [sdb] No Caching mode page present
+[  564.485438] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  564.489141]  sdb: sdb1 sdb2
+[  565.721590] EXT4-fs (sdb2): ext4_orphan_cleanup: deleting unreferenced inode 15287
+[  565.728591] EXT4-fs (sdb2): 1 orphan inode deleted
+[  565.728596] EXT4-fs (sdb2): recovery complete
+[  565.775749] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
+[  565.775777] SELinux: initialized (dev sdb2, type ext4), uses xattr
+[  568.443690] sd 2:0:0:0: [sdb] No Caching mode page present
+[  568.443700] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  569.209293] SELinux: initialized (dev sdb1, type vfat), uses genfs_contexts
+[  573.564543] sd 2:0:0:0: [sdb] No Caching mode page present
+[  573.564550] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  585.852488] sd 2:0:0:0: [sdb] No Caching mode page present
+[  585.852497] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  585.861236] sd 2:0:0:0: [sdb] No Caching mode page present
+[  585.861242] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  585.864972]  sdb: sdb1 sdb2
+[  595.580615] sd 2:0:0:0: [sdb] No Caching mode page present
+[  595.580622] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  595.589362] sd 2:0:0:0: [sdb] No Caching mode page present
+[  595.589370] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  595.593242]  sdb: sdb1 sdb2
+[  599.163273] sd 2:0:0:0: [sdb] No Caching mode page present
+[  599.163285] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  599.173522] sd 2:0:0:0: [sdb] No Caching mode page present
+[  599.173533] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  599.177461]  sdb: sdb1 sdb2
+[  606.844234] sd 2:0:0:0: [sdb] No Caching mode page present
+[  606.844242] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  606.853108] sd 2:0:0:0: [sdb] No Caching mode page present
+[  606.853116] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  606.856972]  sdb: sdb1 sdb2
+[  610.826944] sd 2:0:0:0: [sdb] No Caching mode page present
+[  610.826951] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  610.835567] sd 2:0:0:0: [sdb] No Caching mode page present
+[  610.835575] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  610.839311]  sdb: sdb1 sdb2
+[  616.572236] sd 2:0:0:0: [sdb] No Caching mode page present
+[  616.572245] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  616.581107] sd 2:0:0:0: [sdb] No Caching mode page present
+[  616.581114] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  616.584847]  sdb: sdb1 sdb2
+[  619.642472] sd 2:0:0:0: [sdb] No Caching mode page present
+[  619.642480] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  619.651344] sd 2:0:0:0: [sdb] No Caching mode page present
+[  619.651351] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  619.655103]  sdb: sdb1 sdb2
+[  624.579192] sd 2:0:0:0: [sdb] No Caching mode page present
+[  624.579202] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  624.584043]  sdb: sdb1 sdb2
+[  625.724586] sd 2:0:0:0: [sdb] No Caching mode page present
+[  625.724594] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  625.731706] sd 2:0:0:0: [sdb] No Caching mode page present
+[  625.731712] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  625.735413]  sdb: sdb1 sdb2
+[  629.772655] sd 2:0:0:0: [sdb] No Caching mode page present
+[  629.772663] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  629.781402] sd 2:0:0:0: [sdb] No Caching mode page present
+[  629.781409] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  629.785140]  sdb: sdb1 sdb2
+[  630.434323] sd 2:0:0:0: [sdb] Media Changed
+[  630.434331] sd 2:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
+[  630.434336] sd 2:0:0:0: [sdb]  Sense Key : Unit Attention [current] 
+[  630.434342] Info fld=0x0
+[  630.434345] sd 2:0:0:0: [sdb]  Add. Sense: Not ready to ready change, medium may have changed
+[  630.434354] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 03 50 00 00 08 00
+[  630.434365] end_request: I/O error, dev sdb, sector 848
+[  630.434375] Buffer I/O error on device sdb, logical block 106
+[  630.449839] sd 2:0:0:0: [sdb] No Caching mode page present
+[  630.449849] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  630.457717] sd 2:0:0:0: [sdb] No Caching mode page present
+[  630.457727] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  630.461795]  sdb: sdb1 sdb2
+[  634.377191] sd 2:0:0:0: [sdb] No Caching mode page present
+[  634.377200] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  634.386260] sd 2:0:0:0: [sdb] No Caching mode page present
+[  634.386267] sd 2:0:0:0: [sdb] Assuming drive cache: write through
+[  634.389996]  sdb: sdb1 sdb2
[vincent@localhost ~]$ 

Merci beaucoup pour ton acharnement ! =P

+0 -0

Bon, alors, après avoir cherché un peu au niveau de fld=0x0, et bah on tombe sur pleins de topics non résolus avec un problème de ce genre …

Conclusion : RIP carte SD …

Mais, il y a quand même un truc génial dans tout ça, c'est que ça reste logique ! :ninja:

1
2
3
[  233.137107] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 ed 5f f8 00 00 01 00
[  233.137118] end_request: I/O error, dev sdb, sector 15556600
[  233.137127] Buffer I/O error on device sdb, logical block 1944575

pour le formatage de sdb2 (donc relativement loin dans la carte SD), par rapport à :

1
2
3
[  630.434354] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 03 50 00 00 08 00
[  630.434365] end_request: I/O error, dev sdb, sector 848
[  630.434375] Buffer I/O error on device sdb, logical block 106

pour la MBR. Oui, j'essaie de positiver comme je peux …

Après, pour la cause de tout ça, celle qui est directe est :

1
[  630.434323] sd 2:0:0:0: [sdb] Media Change

signifiant donc que le truc derrière a changé, et visiblement après il repasse en lecture seule (d'après ce que je comprends, au moment d'écrire pour la première fois dedans o_O ). Après, pourquoi ça fait ça, aucune idée …

Bonne soirée !

+0 -0
Connectez-vous pour pouvoir poster un message.
Connexion

Pas encore membre ?

Créez un compte en une minute pour profiter pleinement de toutes les fonctionnalités de Zeste de Savoir. Ici, tout est gratuit et sans publicité.
Créer un compte