Skip to content

Disque corrompu sur un dédié OVH ou Online

Auteur : Philippe Le Van - @plv@framapiaf.org

Date : 24 février 2022

Introduction

Cette page donne une résolution possible d'un problème de corruption de disque sur un serveur OVH ou Dedibox (Scaleway - Online).

principe

Passer le serveur en mode rescue et se connecter en root.

Récupérer les partitions à réparer :

1
2
3
# 2 solutions possibles
fdisk -l
lsblk -f

Réparation

1
2
# suivant les résultats des commandes précédentes, il faut utiliser fsck ...
fsck /dev/xxx

Exemple 1 : pas de raid, dedibox

 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
root@xxx:/# fdisk -l
Disk /dev/loop0: 523,8 MiB, 549273600 bytes, 1072800 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 /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000b76c2

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          2048     409599     407552   199M 83 Linux
/dev/sda2           409600 1951375359 1950965760 930,3G 83 Linux
/dev/sda3       1951375360 1953523711    2148352     1G 82 Linux swap / Solaris
root@xxx:/# fsck /dev/sda1
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
/dev/sda1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 297/51000 files (0.7% non-contiguous), 48957/203776 blocks
root@xxx:/# fsck /dev/sda2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
/dev/sda2 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda2: 894109/60973056 files (0.2% non-contiguous), 19129589/243870720 blocks
root@xxx:/# fsck /dev/sda1
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
/dev/sda1: clean, 297/51000 files, 48957/203776 blocks
root@xxx:/# fsck /dev/sda2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
/dev/sda2: clean, 894109/60973056 files, 19129589/243870720 blocks
root@xxx:/# fsck /dev/sda3
fsck from util-linux 2.31.1
root@xxx:/#

Exemple 2 : Soyoustart, OVH, avec Raid

 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
root@rescue:~# lsblk -f
NAME      FSTYPE       LABEL     UUID                                 MOUNTPOINT
sdb                                                                   
├─sdb2    linux_raid_m md2       66561f6f-68f6-e5fa-de95-755e03224c8c  └─md127 ext4         root      e547c84d-fe14-40fa-8ec3-113e8fc2c5c7 
├─sdb3    swap         swap-sdb3 a2694b3c-ea49-4999-b201-efee92ef924f 
└─sdb1                                                                
sdc                                                                   
├─sdc2    linux_raid_m md2       66561f6f-68f6-e5fa-de95-755e03224c8c  └─md127 ext4         root      e547c84d-fe14-40fa-8ec3-113e8fc2c5c7 
├─sdc3    swap         swap-sdc3 e6d2e1ca-b0e1-45de-89b6-5241b4322a66 
└─sdc1                                                                
sda                                                                   
├─sda4    iso9660      config-2  2021-10-28-15-07-34-00               
├─sda2    linux_raid_m md2       66561f6f-68f6-e5fa-de95-755e03224c8c  └─md127 ext4         root      e547c84d-fe14-40fa-8ec3-113e8fc2c5c7 
├─sda3    swap         swap-sda3 1ddb6488-6f48-42f8-b4ad-96f4740d0ffb 
└─sda1                                                                
root@rescue:~# fsck /dev/md127
fsck from util-linux 2.25.2
e2fsck 1.42.12 (29-Aug-2014)
root contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix<y>? yes
Inode 24908448 was part of the orphaned inode list.  FIXED.
Deleted inode 43778737 has zero dtime.  Fix<y>? yes
Inode 43778740 was part of the orphaned inode list.  FIXED.
Inode 43778742 was part of the orphaned inode list.  FIXED.
Inode 43778764 was part of the orphaned inode list.  FIXED.
Inode 83104610 was part of the orphaned inode list.  FIXED.
Pass 2: Checking directory structure
Entry 'translog-15.tlog' in /home/cloud/containers/elasticsearch/data/nodes/0/indices/s_7OW07FTc-TiQKnxTWP9g/1/translog (44175764) has deleted/unused inode 44177079.  Clear<y>? yes
Entry 'translog-15.tlog' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/s_7OW07FTc-TiQKnxTWP9g/1/translog (44175651) has deleted/unused inode 44177083.  Clear<y>? yes
Entry '_9ck.fdx' in /home/cloud/containers/elasticsearch/data/nodes/0/indices/b_-HZnBcSmqjiy-fY4h1nA/2/index (44179824) has deleted/unused inode 44177085.  Clear<y>? yes
Entry '_k83.si' in /home/cloud/containers/elasticsearch/data/nodes/0/indices/ag-IYwnnRmunM_2qWRCP5g/1/index (44180723) has deleted/unused inode 44177088.  Clear<y>? yes
Entry '_i3z_Lucene50_0.tip' in /home/cloud/containers/elasticsearch/data/nodes/0/indices/EHSsfd9GQ7OiHz0B7fKreQ/3/index (44176819) has deleted/unused inode 44177080.  Clear<y>? yes
Entry '_6g1_Lucene70_0.dvd' in /home/cloud/containers/elasticsearch/data/nodes/0/indices/XHYAInk9TTK7y_4JHkHuIw/3/index (44177679) has deleted/unused inode 44177086.  Clear<y>? yes
Entry '_d8c.dim' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/EHSsfd9GQ7OiHz0B7fKreQ/2/index (44176534) has deleted/unused inode 44177076.  Clear<y>? yes
Entry '_d8c.dii' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/EHSsfd9GQ7OiHz0B7fKreQ/2/index (44176534) has deleted/unused inode 44177077.  Clear<y>? yes
Entry '_d8c.si' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/EHSsfd9GQ7OiHz0B7fKreQ/2/index (44176534) has deleted/unused inode 44177087.  Clear<y>? yes
Entry '_d8c.fnm' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/EHSsfd9GQ7OiHz0B7fKreQ/2/index (44176534) has deleted/unused inode 44177084.  Clear<y>? yes
Entry '_r14.cfs' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/EHSsfd9GQ7OiHz0B7fKreQ/2/index (44176534) has deleted/unused inode 44177082.  Clear<y>? yes
Entry '_d8c_Lucene70_0.dvm' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/EHSsfd9GQ7OiHz0B7fKreQ/2/index (44176534) has deleted/unused inode 44177073.  Clear<y>? yes
Entry '_fg4.dim' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/XHYAInk9TTK7y_4JHkHuIw/0/index (44177570) has deleted/unused inode 44177078.  Clear<y>? yes
Entry '_9tt.si' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/XHYAInk9TTK7y_4JHkHuIw/0/index (44177570) has deleted/unused inode 44177074.  Clear<y>? yes
Entry '_fm7_Lucene50_0.doc' in /home/cloud/containers/elasticsearch1/data/nodes/0/indices/EQ8vPfiBS6mvSlL8NAYHbg/4/index (44178699) has deleted/unused inode 44177075.  Clear<y>? yes
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(93229056--93230079) -(93230789--93230802) -(99693924--99693969) -(176772608--176773114) -177223752 -177230009 -177231285 -(177661253--177661262) -(177661280--177661293) -177664738 -(177742272--177742276) -(177776996--177777020) -(178451723--178451962) -(179520736--179520758) -(179520768--179520795) -(179520800--179520827) -(180368461--180368894) -(181280663--181281345) -(181291360--181291830) -332508635 -332508672 -332515366
Fix<y>? yes
Free blocks count wrong for group #2845 (31730, counted=32768).
Fix<y>? yes
Free blocks count wrong for group #3042 (20081, counted=20127).
Fix<y>? yes
Free blocks count wrong for group #5394 (19651, counted=20158).
Fix<y>? yes
Free blocks count wrong for group #5408 (24539, counted=24542).
Fix<y>? yes
Free blocks count wrong for group #5421 (30691, counted=30716).
Fix<y>? yes
Free blocks count wrong for group #5424 (24533, counted=24538).
Fix<y>? yes
Free blocks count wrong for group #5425 (28592, counted=28617).
Fix<y>? yes
Free blocks count wrong for group #5445 (24237, counted=24477).
Fix<y>? yes
Free blocks count wrong for group #5478 (30423, counted=30502).
Fix<y>? yes
Free blocks count wrong for group #5504 (23304, counted=23738).
Fix<y>? yes
Free blocks count wrong for group #5532 (4900, counted=6054).
Fix<y>? yes
Free blocks count wrong for group #10147 (30521, counted=30524).
Fix<y>? yes
Free blocks count wrong (412975441, counted=409766054).
Fix<y>? yes
Inode bitmap differences:  -24908448 -43778737 -43778740 -43778742 -43778764 -(44177073--44177080) -(44177082--44177088) -83104610
Fix<y>? yes
Free inodes count wrong for group #3040 (5561, counted=5562).
Fix<y>? yes
Free inodes count wrong for group #5344 (6540, counted=6544).
Fix<y>? yes
Free inodes count wrong for group #5392 (7764, counted=7779).
Fix<y>? yes
Free inodes count wrong for group #10144 (3038, counted=3039).
Fix<y>? yes
Free inodes count wrong (121597145, counted=121593036).
Fix<y>? yes

root: ***** FILE SYSTEM WAS MODIFIED *****
root: 467764/122060800 files (2.1% non-contiguous), 78447706/488213760 blocks
root@rescue:~# fsck /dev/md127
fsck from util-linux 2.25.2
e2fsck 1.42.12 (29-Aug-2014)
root: clean, 467764/122060800 files, 78447706/488213760 blocks
root@rescue:~# logout