Commandes utiles pour dépanner un PC sous Linux

Pour établir un état général de son installation Linux, il existe un outil très puissant appelé boot-repair qui permet de réaliser des rapports d’informations (boot-info) très complets. Mais, on n’a pas forcément besoin de tout, et il semble que l’application soit en état de latence prolongée.

Par conséquent, il n’est pas inutile d’apprendre à connaître celles qui permettent de faire un état des lieux pour espérer se dépanner en cas de problème.

Plutôt qu’un ordre alphabétique, on va les proposer par catégories, avec un exemple de résultat obtenu.

1. Identification des caractéristiques du système

  • uname (options principales -a, -r)
ikewdu@PCIKE-LMDE:~$ uname -a
Linux PCIKE-LMDE 6.12.85+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.85-1 (2026-04-30) x86_64 GNU/Linux
  • lsb_release  (option -a notamment)
ikewdu@PCIKE-LMDE:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	LMDE 7 (gigi)
Release:	7
Codename:	gigi
  • ou plus complet avec cat
ikewdu@PCIKE-LMDE:~$ cat /etc/os-release
PRETTY_NAME="LMDE 7 (gigi)"
NAME="LMDE"
VERSION_ID="7"
VERSION="7 (gigi)"
VERSION_CODENAME=gigi
ID=linuxmint
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
ID_LIKE=debian
DEBIAN_CODENAME=trixie
DEBIAN_VERSION_FULL=13.0
  • cat /proc/version
ikewdu@PCIKE-LMDE:~$ cat /proc/version
Linux version 6.12.85+deb13-amd64 (debian-kernel@lists.debian.org) (x86_64-linux-gnu-gcc-14 (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44) #1 SMP PREEMPT_DYNAMIC Debian 6.12.85-1 (2026-04-30)

On pourra également regarder du côté des commandes lshw ou inxi qui donneront d’autres informations, plus détaillées, sur le matériel.

2. Bios et UEFI

  • Commande od (présence d’un grub dans le secteur 0, même sur disque gpt):
ikewdu@PCIKE-LMDE:~$ sudo od -tx1z -Ax -N 512 /dev/sda |grep -i rub
[sudo: authenticate] Mot de passe :     
000180 7d e8 2e 00 cd 18 eb fe 47 52 55 42 20 00 47 65  >}.......GRUB .Ge
  • Autre moyen de lire le secteur 0 d’un disque avec dd :
ikewdu@PCIKE-LMDE:~$ sudo dd if=/dev/sda bs=512 skip=1 count=1 | hexdump -C
00000000  45 46 49 20 50 41 52 54  00 00 01 00 5c 00 00 00  |EFI PART....\...|
00000010  99 43 fb 91 00 00 00 00  01 00 00 00 00 00 00 00  |.C..............|
00000020  af c2 e7 0e 00 00 00 00  22 00 00 00 00 00 00 00  |........".......|
1+0 enregistrements lus
1+0 enregistrements écrits
512 octets copiés, 0,000274103 s, 1,9 MB/s00000030  8e c2 e7 0e 00 00 00 00  1c b5 09 0e f7 3d 1f 4f  |.............=.O|
00000040  b3 82 3c ae d4 71 da 5b  02 00 00 00 00 00 00 00  |..<..q.[........|
00000050  80 00 00 00 80 00 00 00  50 c1 c4 ce 00 00 00 00  |........P.......|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  • La commande pour savoir dans quel mode on boote (Legacy ou UEFI) : [ -d /sys/firmware/efi ]
ikewdu@PCIKE-LMDE:~$ [ -d /sys/firmware/efi ] && echo "Session EFI" || echo "Session non-EFI"
Session EFI
  • Affichage des entrées en NVram en UEFI  (la Nvram de ce PC est plombée) : efibootmgr
ikewdu@PCIKE-LMDE:~$ efibootmgr -v
Skipping unreadable variable "Boot0001": Input/output error
error trace:
 efivarfs.c:275 efivarfs_get_variable(): read failed: Input/output error
 lib.c:140 efi_get_variable(): ops->get_variable failed: Input/output error
  • Etat du secure-boot par mokutil :
ikewdu@PCIKE-LMDE:~$ mokutil --sb-state
Secure Boot disabled

3. Identification des disques et partitions

  • fdisk (options -l, -lu (ou |grep 'chaîne' pour ne voir qu'une partie)
ikewdu@PCIKE-LMDE:~$ sudo fdisk -l |grep -E 'dev|typ'
[sudo] Mot de passe de ikewdu :         
Disk /dev/sda: 119,24 GiB, 128035676160 bytes, 250069680 sectors
Disklabel type: gpt
/dev/sda1       2048   1023999   1021952  499M EFI System
/dev/sda2    1024000   1286143    262144  128M Microsoft reserved
/dev/sda3    1286144 156220371 154934228 73,9G Microsoft basic data
/dev/sda4  248381440 250066943   1685504  823M Windows recovery environment
/dev/sda5  156221440 248381439  92160000 43,9G Linux filesystem
Disk /dev/mmcblk0: 29,12 GiB, 31272206336 bytes, 61078528 sectors
Disklabel type: dos
/dev/mmcblk0p1       2048 61077503 61075456 29,1G  c W95 FAT32 (LBA
  • La commande lsblk (autre manière de voir les partitions. Option -T pour forcer le tri)
ikewdu@PCIKE-LMDE:~$ lsblk -T
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 119,2G  0 disk 
├─sda1        8:1    0   499M  0 part /boot/efi
├─sda2        8:2    0   128M  0 part 
├─sda3        8:3    0  73,9G  0 part 
├─sda4        8:4    0   823M  0 part 
└─sda5        8:5    0  43,9G  0 part /
mmcblk0     179:0    0  29,1G  0 disk 
└─mmcblk0p1 179:1    0  29,1G  0 part /media/ikewdu/MINI-SD

La commande df, pour voir l'occupation des disques

ikewdu@PCIKE-LMDE:~$ df -TH
Sys. de fichiers Type     Taille Utilisé Dispo Uti% Monté sur
udev             devtmpfs   2,0G       0  2,0G   0% /dev
tmpfs            tmpfs      392M    1,7M  390M   1% /run
/dev/sda5        ext4        47G     17G   27G  39% /
tmpfs            tmpfs      2,0G     39M  2,0G   2% /dev/shm
tmpfs            tmpfs      5,3M    8,2k  5,3M   1% /run/lock
tmpfs            tmpfs      2,0G    3,9M  2,0G   1% /tmp
tmpfs            tmpfs      1,1M       0  1,1M   0% /run/credentials/systemd-journald.service
/dev/sda1        vfat       520M     41M  479M   8% /boot/efi
tmpfs            tmpfs      1,1M       0  1,1M   0% /run/credentials/getty@tty1.service
tmpfs            tmpfs      392M    193k  392M   1% /run/user/1000
/dev/mmcblk0p1   vfat        32G     12M   32G   1% /media/ikewdu/MINI-SD
  • blkid ou sudo blkid (affichage des UUID des partitions)
ikewdu@PCIKE-LMDE:~$ blkid
/dev/sda4: LABEL="Winre" BLOCK_SIZE="512" UUID="D45243FD5243E2BA" TYPE="ntfs" PARTUUID="7769ceec-d492-4b0b-bd1e-0e291e03dd38"
/dev/sda5: UUID="657a3c25-e204-4d29-b4ee-0c6e52627497" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="4bfba239-2fe3-4522-bf10-946a28da3b2c"
/dev/sda3: LABEL="Windows10" BLOCK_SIZE="512" UUID="206A0B456A0B16E6" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="85198382-0484-4c68-9c70-83c453720faa"
/dev/sda1: LABEL_FATBOOT="BOOT" LABEL="BOOT" UUID="C40A-8738" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="a828521e-c643-40d3-aed5-3f938cd9bc1d"

4. Voir  la stratégie de montage des partitions (fstab)

  • La commande cat /etc/fstab
ikewdu@PCIKE-LMDE:~$ cat /etc/fstab
#### Static Filesystem Table File
proc	/proc	proc	defaults	0	0
# /dev/sda1
UUID=C40A-8738	/boot/efi	vfat	defaults	0	1
# /dev/sda5
UUID=657a3c25-e204-4d29-b4ee-0c6e52627497	/	ext4	rw,errors=remount-ro	0	1

On notera qu'on dispose également de la commande sudo parted -l qui fournit des résultats proches de fdisk.

4. Le paramétrage de grub

  • La commande cat pour afficher le paramétrage de grub
ikewdu@PCIKE-LMDE:~$ cat /etc/default/grub
# If you change this file or any /etc/default/grub.d/*.cfg file,
# run 'update-grub' afterwards to update /boot/grub/grub.cfg.
# For full documentation of the options in these files, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`( . /etc/os-release && echo ${NAME} )`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
#GRUB_DISABLE_OS_PROBER=false

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE/GOP/UGA
# you can see them in real GRUB with the command `videoinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
  • La commande cat combinée à grep (pour faire plus propre)
ikewdu@PCIKE-LMDE:~$ cat  | grep -v '#' /etc/default/grub

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`( . /etc/os-release && echo ${NAME} )`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""
  • Lire avec cat la redirection de grub en efi ('debian' à remplacer par le dossier correct).
ikewdu@PCIKE-LMDE:~$ cat /boot/efi/EFI/debian/grub.cfg
search.fs_uuid 657a3c25-e204-4d29-b4ee-0c6e52627497 root hd0,gpt5 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
  • Voir avec cat tout le fichier de config de grub (pas forcément utile, mais bon...)
ikewdu@PCIKE-LMDE:~$ sudo cat /boot/grub/grub.cfg
[sudo] Mot de passe de ikewdu :         
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
(j'arrête là pour une question de longueur)

 5. Voir le contenu des partitions importantes (EFI notamment)

Les fichiers efi dans la partition de sa distribution avec ls

ikewdu@PCIKE-LMDE:~$ ls -lR /boot/efi/EFI/*/*.efi
-rwxr-xr-x 1 root root 1273656  3 mai    2019 /boot/efi/EFI/Boot/bootx64.efi
-rwxr-xr-x 1 root root   87888 27 nov.  07:47 /boot/efi/EFI/debian/fbx64.efi
-rwxr-xr-x 1 root root 2684352 27 nov.  07:47 /boot/efi/EFI/debian/grubx64.efi
-rwxr-xr-x 1 root root  850176 27 nov.  07:47 /boot/efi/EFI/debian/mmx64.efi
-rwxr-xr-x 1 root root  957136 27 nov.  07:47 /boot/efi/EFI/debian/shimx64.efi

En cas de dual-boot, pour voir aussi les fichiers de Windows avec ls :

ikewdu@PCIKE-LMDE:~$ ls -lR /boot/efi/EFI/*/*.efi && ls -lR /boot/efi/EFI/*/*/*.efi
-rwxr-xr-x 1 root root 1273656  3 mai    2019 /boot/efi/EFI/Boot/bootx64.efi
-rwxr-xr-x 1 root root   87888 27 nov.  07:47 /boot/efi/EFI/debian/fbx64.efi
-rwxr-xr-x 1 root root 2684352 27 nov.  07:47 /boot/efi/EFI/debian/grubx64.efi
-rwxr-xr-x 1 root root  850176 27 nov.  07:47 /boot/efi/EFI/debian/mmx64.efi
-rwxr-xr-x 1 root root  957136 27 nov.  07:47 /boot/efi/EFI/debian/shimx64.efi
-rwxr-xr-x 1 root root 1273656  3 mai    2019 /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
-rwxr-xr-x 1 root root 1256760  3 mai    2019 /boot/efi/EFI/Microsoft/Boot/bootmgr.efi
-rwxr-xr-x 1 root root 1103672  3 mai    2019 /boot/efi/EFI/Microsoft/Boot/memtest.efi

6. Les paquets et leur état

  • Voir si on a des paquets cassés  avec dpkg :
ikewdu@PCIKE-LMDE:~$ dpkg -l | grep -v ^ii

Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=attend-traitement-déclenchements
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom                                        Version                               Architecture Description
+++-==========================================-=====================================-============-================================================================================
hi  grub-efi-amd64                             2.12-9                                amd64        GRand Unified Bootloader, version 2 (EFI-AMD64 version)
hi  grub-efi-amd64-signed                      1+2.12+9                              amd64        GRand Unified Bootloader, version 2 (amd64 UEFI signed by Debian)