Raspberry Pi Catch-All

Heretk wrote:

Still a total Linux noob here.

I added an external WD 4TB SSD and Google-fu'ed my way into using a Samba share to set it up. Everything worked great, I could access the drive from all of my PCs, even my phone. Up until I had to reboot the Pi 4 and now the drive is not accessible. Is there a proper way to mount a drive in Raspian where it will auto-mount after a reboot?

There's two components to sharing a drive; you have to mount it (what you're asking about), which makes it available to the Pi itself. Then you have to share it, which makes the shared directory visible on the network.

The first thing to do is to verify that you can see the files in the correct place from the Pi. Log into that and look in the filesystem, and make sure the files are showing up where you expect them to be. If they're gone, then it's a mount problem, and we can try to fix that.

If you see the files on the Pi, but you don't see the share on the network, then Samba probably isn't starting or running correctly. That would be a separate troubleshooting process.

This might take a few back-and-forths, because there are numerous ways to mount filesystems on Linux, and we'll have to figure out what approach you took. Samba tends to be more straightforward, so that'll probably just take a tweak or two if that's actually the problem.

After the initial setup I could see the WD drive on the Pi and via my LAN from other PCs. After the Pi reboot I cannot see the drive on the network. It is visible on the Pi but when I try and open it it asks me to log in as root. I created a separate admin user when I first set up the Pi but it only gives me an option to log in as user root.

I have never used the root account and the passwords I had documented are not working. Defaults also not working. About ready to scorch the earth and rebuild everything from the bottom up.

but when I try and open it it asks me to log in as root

Okay, that sounds like a permissions problem. What filesystem are you using on the WD drive? (there are many options, but the most frequent is ext4. If it's FAT or NTFS, that could be a problem... will go into that if they are.) Fixing that will require root access, and there are several ways to try to get it... hopefully you haven't locked yourself out.

The Raspbian default is to have no password on root. Try opening a command line and typing "su -". Just hit enter if it asks for a password. If the prompt changes to #, you're golden. (although we should set a root password.)

You should also be able to get root by opening a command prompt and typing "sudo su -", and typing in your user password, not the root password. Sudo lets you run something as root using your normal password. This is a special permission that's granted via the /etc/sudoers file. (in other words, it's separate system grafted onto the side of Unix, like so many things are.)

I believe the default pi account should be in /etc/sudoers, so "sudo su -" should give you a root prompt. If you're using a different account or you messed with that file in some way, it might refuse to work.

A third way to try to get root is to use control-alt-F1 to get a text mode prompt, where you can try to log in as root there. (username root, no password.) Getting back to the desktop from text mode usually works with alt-F7. Most distros will start login prompts on multiple virtual terminals, and will tie the graphic system to one of them. In text mode, alt-F1 through alt-F10 switches between them...you can search and find the desktop if it's not on F7. In graphic mode, you have to use both control AND alt with the function keys to switch. Control-alt-FX in graphic mode, just alt-FX in text. (I think control-alt might also work in text mode, but I don't remember for sure.)

If you can't get a root prompt, then it might be easiest to nuke and repave, but if any of these approaches work, you should be fine. As long as you can get root, most problems can be fixed, including this permissions thing.

I honestly do not remember what file format I used.

I need to pull the RP4 anyway as the case fan has a bad bearing and is making a heck of a lot of noise. Will pull the old SD card and rebuild on a new card just in case. The Pi has been great to play with and I have learned a lot. But it's clear I have more learning to do, otherwise I would not have painted myself into this corner

Thanks all for the help and insight!

Okay, but keep in mind that you probably don't need to do that from a software perspective. My post was long because I was giving you three different ways to get a root prompt.... chances are quite good that you can stop after the second paragraph.

The fan going bad is no shock, I lost my first one too. Lots of these cases use really crappy fans. I replaced it with a GeeekPi case that uses a nice 40x10mm, so it's a standard size and easy to replace if it fails. It's been great for about a year now.

Malor wrote:

Okay, but keep in mind that you probably don't need to do that from a software perspective. My post was long because I was giving you three different ways to get a root prompt.... chances are quite good that you can stop after the second paragraph.

The fan going bad is no shock, I lost my first one too. Lots of these cases use really crappy fans. I replaced it with a GeeekPi case that uses a nice 40x10mm, so it's a standard size and easy to replace if it fails. It's been great for about a year now.

Checking in to mark this one as mostly resolved. Changed the case fan first to build a sense of accomplishment before re-examining the NAS drive issue. I found the original FAQ online to re-trace my steps. I then remounted the external HD from command line. Also turns out that I skipped the very last step of said guide, which illustrated how to update /fstab to make the drive automount after reboot. Tested and it works.

My original quandry was that I was trying to sort this out through Raspian GUI. Whenever I tried to mount the drive I got the prompt to login as root, and none of my passwords were accepted. When I first set up this Pi I did create a separate superuser account which works in the command line but said superuser credentials do not work in the GUI. In the GUI I only have the option to login as user root.

Thanks all for your help on this.

When I first set up this Pi I did create a separate superuser account which works in the command line but said superuser credentials do not work in the GUI. In the GUI I only have the option to login as user root.

I haven't gone through a basic Pi install in a long time, but it sounds like you're saying it prompted you to make a third account? A default Raspbian comes with root and pi for users. Did you make another? And only root, AFAIK, can have full root privs, so I'm unclear on how a "superuser" account would work. I think that's a Windows-ism that doesn't directly translate to Unix.

From your description, I'm almost entirely mystified as to how things are actually configured.

The Pi GUI is probably asking you for root's password. That's not always set; it's common to lock out root and then to require sudo. If you manually set a root password (sudo to a root CLI, type 'passwd root', and set it to whatever you want), the GUI then should, when provided with that password, correctly elevate itself and mount a drive for you.

But it sounds like you fixed fstab, which means you may not need to do that for a great long while. We would have gotten there eventually... that was the reason I was asking if you could see the files on the Pi. If you couldn't, we would have rebuilt a new fstab line to set it to automount.