How to fix the issue of being unable to access a mounted hard drive in OpenWRT.

If you have mounted a hard drive on OpenWrt but cannot access it, you can follow these steps to resolve the issue:

  1. Make sure the hard drive is properly connected and recognized.
  2. Run the command dmesg | grep -i scsi to check if the hard drive is recognized.
  3. Execute the command ls /dev/sd* to check for the existence of hard drive device files.
  4. Format the hard drive and create a file system.
  5. Run the command ‘fdisk -l’ to check the disk partition situation.
  6. Execute the command mkfs.ext4 /dev/sdXN (replace X with the disk device number, and N with the partition number) to format the partition as an ext4 file system.
  7. Mount hard drive:
  8. Run the command “mkdir /mnt/hdd” to create a mount point (which can be customized).
  9. Run the command “mount /dev/sdXN /mnt/hdd” to mount the hard drive partition to the specified mount point.
  10. Automatically mount:
  11. Edit the file /etc/config/fstab and add the following:

    config mount
    option target /mnt/hdd
    option device /dev/sdXN
    option fstype ext4
    option options rw,sync
    option enabled 1

    (Replace X with the device number of the hard drive, and N with the partition number)

  12. Run the command “/etc/init.d/fstab enable” to enable auto-mounting.
  13. Reboot OpenWrt and verify if the hard drive can be accessed.

If the issue persists, you may need to check the health status of the hard drive or try reconnecting the hard drive.

bannerAds