Rebuilding on Pi4 with 12TB MyBook: problems and solutions

My channels DVR running on Raspberry Pi 4 experienced failure of both the external USB disk and the micro SD card.

I had an old backup of the running system. I purchased a new 12TB MyBook USB drive and a new SD card. I copied all of the old files to the new MyBook.
I followed the installation instructions for a new system published on TechHive, the same way I had created the original system, but things did not go well.

  1. Instructions said to download Raspbian Buster Lite form the Raspberry Pi website. found out there is now a Raspberry Pi imager tool, which I instead used to install Raspbian onto the SD card.

  2. Instructions said I should be able to open the SD card in File Explorer in Windows. This did not work on Windows 10.

  3. Instructions said to start the Raspberry Pi and edit /etc/fstab to include the mount info. for the USB disk, such as "dev/sda1 /mnt ntfs defaults 0 0" and reboot. After rebooting Raspberry Pi would hang. I connected a monitor and keyboard and discovered the mount of the USB disk was failing, system was
    starting in emergency mode but login was not allowed because the root account was locked.

To solve this I had to edit the fstab file from another system - all I had available was Windows 10, but I couldn't open the SD card on Windows 10.
So, I installed Linux File Systems for Windows from Paragon Software (Linux File Systems for Windows | Paragon Software) on Windows system and changed the fstab file to remove
the mount of /dev/sda1. I then enabled the root file system using "sudo passwd root" and specifying a new password and then "sudo passwd --unlock root".

I found an article that said I could change fstab to specify "defaults,nofail" to prevent startup failure when the USB disk is not available. I also changed "ntfs" to "auto" to successfully mount the USB disk:
"dev/sda1 /mnt auto defaults,nofail 0 0".
With these changes I was able to get the Raspberry Pi to startup.
I logged into the pi account and installed chromium and channels dvr.

  1. I could now access Channels and invoke the restore function to import my database backup files, but channels said no files were found even though the file
    names were displayed. I checked the filename permissions (with ls -l) and it showed the pi user had no access. I tried changing the permissions with the
    chmod comand but the permissions would not change. I used fdisk -l to examine the disk but it gave no useful information. I mounted the USB disk back on Windows10
    and found that the disk filesystem was exFAT, which does not have the ability to use file permissions. I found an article that showed how to set a default permission for the USB drive by adding umask=000 to the mount command. I changed the fstab entry to
    "dev/sda1 /mnt exfat defaults,nofail,umask=000 0 0".
    After rebooting the raspberry pi, I found the permissions on the channels database files allowed read and write access to everyone.

  2. Went back to channels dvr and tried the restore function again, but it still said no files found. Poking around in the forums I found there can be problems when multiple database backup directories exist.
    I deleted all of the backup directories except the newest and then it worked.

Everything runs fine now! In hindsight, I'm not sure all of my "fixes" were actually needed, but hopefully you can learn something from my experiences.