Boot PiDrive

Bonjour @ tous !

Je dispose d’un jeedom monté sur un RPI 2 B+ associé depuis longtemps à un disque WD PiDrive et qui semblait fonctionner parfaitement. Plus de plantage lié à la carte SD.
Je me suis rendu compte que l’outil monitoring ne me donne pas la bonne taille de l’espace disque. C’est cohérent avec l’outil santé.
La commande findmnt me confirme le souci.

j@raspberrypi:~ $ findmnt -n -o SOURCE /
/dev/mmcblk0p2

Est-ce qu’une âme charitable pourrait me donner un coup de pouce pour réparer et remettre les choses en place. J’avais suivi un tuto spécifique pour ce disque à l’époque.

Merci.

Je joins des informations que j’ai récupérées :

df :

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root        7528140 5298056   1827960  75% /
devtmpfs          469544       0    469544   0% /dev
tmpfs             474152       0    474152   0% /dev/shm
tmpfs             474152   24132    450020   6% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             474152       0    474152   0% /sys/fs/cgroup
/dev/mmcblk0p1     41853   22861     18992  55% /boot
tmpfs              94828       0     94828   0% /run/user/1001

fdisk :

Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 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: 0xaeebefd0

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    93236    85045 41.5M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      94208 15523839 15429632  7.4G 83 Linux

Disk /dev/sda: 232.9 GiB, 250025607168 bytes, 488331264 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: 0xc0964e0f

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1            2048   8390655   8388608    4G 82 Linux swap / Solaris
/dev/sda2         8390656 322963455 314572800  150G 83 Linux
/dev/sda3       322963456 488331263 165367808 78.9G  c W95 FAT32 (LBA)

fstab :

proc            /proc           proc    defaults          0       0
#ancien mmcblck0p1  vfat
PARTUUID=aeebefd0-01  /boot           vfat    defaults,          0       2
#ancien mmcblck0p2  linux ext4
##PARTUUID=aeebefd0-02  /               ext4    defaults,noatime  0       1
#montage sda2 disque dur
/dev/sda2 / ext4 defaults,noatime 0 1
#montage swap
UUID=f98f5844-e49e-469b-861a-292729a968f4 none swap sw 0 0

# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

partuuid :

 ls -l /dev/disk/by-partuuid/
total 0
lrwxrwxrwx 1 root root 15 Aug 10 20:26 aeebefd0-01 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Aug 10 20:26 aeebefd0-02 -> ../../mmcblk0p2
lrwxrwxrwx 1 root root 10 Aug 11 13:43 c0964e0f-01 -> ../../sda1
lrwxrwxrwx 1 root root 10 Aug 11 13:43 c0964e0f-02 -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 11 13:43 c0964e0f-03 -> ../../sda3

cmdline.txt :

 cat  /boot/cmdline.txt
#correspond au boot sur mmcblk0p1
#dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=aeebefd0-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
#
#correspond au boot sur Disque Dur sur sda2
#dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

# modif PiZiGate
dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
$ lsusb
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 001 Device 004: ID 1058:25a2 Western Digital Technologies, Inc. Elements 25A2
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Enfin j’ai monté le disque dur afin de lister son contenu :

jeedom@raspberrypi:/ $ sudo mkdir DISQUEDUR
jeedom@raspberrypi:/ $ ls
DISQUEDUR  boot  etc   lib         media  opt   root  sbin  sys  usr
bin        dev   home  lost+found  mnt    proc  run   srv   tmp  var
jeedom@raspberrypi:/ $ sudo mount /dev/sda2 /DISQUEDUR/
jeedom@raspberrypi:/ $ ls DISQUEDUR/
bin   dev  home  lost+found  mnt  proc  run   srv  tmp  var
boot  etc  lib   media       opt  root  sbin  sys  usr
jeedom@raspberrypi:/ $ ls -l DISQUEDUR/
total 104
drwxr-xr-x   2 root root  4096 Nov  8  2019 bin
drwxr-xr-x   2 root root  4096 Nov 29  2017 boot
drwxr-xr-x   4 root root  4096 Nov 29  2017 dev
drwxr-xr-x 104 root root 12288 Apr  9 18:25 etc
drwxr-xr-x   5 root root  4096 Feb 13  2018 home
drwxr-xr-x  16 root root  4096 Nov  8  2019 lib
drwx------   2 root root 16384 Nov 29  2017 lost+found
drwxr-xr-x   2 root root  4096 Nov 29  2017 media
drwxr-xr-x   4 root root  4096 Dec 18  2017 mnt
drwxr-xr-x   3 root root  4096 Nov 29  2017 opt
drwxr-xr-x   2 root root  4096 Jul 27  2017 proc
drwx------   7 root root  4096 Mar 21  2019 root
drwxr-xr-x   5 root root  4096 Nov 29  2017 run
drwxr-xr-x   2 root root 12288 Nov  8  2019 sbin
drwxr-xr-x   2 root root  4096 Nov 29  2017 srv
drwxr-xr-x   2 root root  4096 Jul 27  2017 sys
drwxrwxrwt   7 root root  4096 Apr 12 10:04 tmp
drwxr-xr-x  11 root root  4096 Jan 14  2018 usr
drwxr-xr-x  13 root root  4096 Feb  2  2019 var

Les dates montrent qu’il y a bien des accès à ce disque. Mais plus depuis le 27/07.
Je ne comprends pas comment ça s’est mélangé !!!

@+ Jean-Marie