Linux Commands to Check HDD from Rescue Mode

Posted on June 1, 2020 at 5:48 pm

Linux commands you can run to check HDD status from Rescue Mode:

1) List disks

ls -la /dev/sd*
ls -la /dev/md*

2) Try to mount a disk

mkdir -p /mnt/md0
mount -t auto /dev/md0 /mnt/md0

3) Check RAID status with MDADM

mdadm --detail /dev/md0

4) Run e2fsck

e2fsck -fp -C 0 /dev/md0

5) Run lsblk

lsblk

Here is an example output from a failing MDADM RAID:

root@server:# ls -la /dev/sd*
ls: cannot access '/dev/sd*': No such file or directory
 
root@server:# ls -la /dev/md*
brw-rw---- 1 root disk 9, 0 mai   30 10:45 /dev/md0
 
root@server:# mkdir -p /mnt/md0
root@server:# mount -t auto /dev/md0 /mnt/md0
mount: /mnt/md0: can't read superblock on /dev/md0
 
root@server:# mdadm --detail /dev/md0
/dev/md0:
        Version :
     Raid Level : raid0
  Total Devices : 0
 
          State : inactive
 
    Number   Major   Minor   RaidDevice
 
root@server:# e2fsck -fp -C 0 /dev/md0
e2fsck: Invalid argument while trying to open /dev/md0
/dev/md0:
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt
 
root@server:# lsblk
NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0   7:0    0 451,5M  0 loop /lib/live/mount/rootfs/img.current.squashfs

Receive updates via email

Other Posts

Updated Posts