Mounted the disk, now can't access the server with ssh or yunohost.local

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.0.10
How are you able to access your server: The webadmin
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: No

Describe your issue

Hello it is me again :),

I followed the documentation to mount my hdd disk for my own server. However after completing almost all the step (except the last one), I can’t connect to my server by using ssh or yunohost.local. My modem still see my server connected to internet. The thing i did different then the tutorial was I wanted to move all home, and i put nextcloud maintenance in the webclient. One thing i suspect is the fstab file not being configured correctly, but since I never opened one before i cannot say. As there was two PARTUID, where one was ext4. I put an # in front of this line to comment it out (I did this after it wasn’t working on the reboot. Tried to fix it)

Thanks !

Share relevant logs or error messages

For the logs, I will share what I have done using ssh and the fstab file :

https://hastebin.skyra.pw/yatadagepi.shell

Hi, me too :wink:

Spot on!

# PARTUUID=51f3b957-02  /               ext4    defaults,noatime  0       1

This is where Yunohost lives. By commenting it out, you are left with only your external HDD, the SD card is not used anymore (not for home, not for mail, and not for Linux/YNH)

If you can still login to you RPi via keyboard/screen, you can uncomment the line that way. Else you can put the SD card in your computer and change the file from there before putting it back it your Pi.

Good luck!

Edit to add: once you turn off your server, I expect it won’t really boot anymore and drop you in an emergency boot shell. No panic. In that case you have to change the file when the SD card is in your computer.

Hello, Thanks for the answer ! I tried to comment it out but still no access.

After I commented out these lines:

UUID="5c55d598-ca1f-49dc-abab-671562ef23e1" /mnt/hdd ext4 defaults,nofail 0 0
/mnt/hdd/home /home none defaults, bind 0 0
/mnt/hdd/var/mail /var/mail none defaults, bind 0 0

And I got access back to the server.
I suppose the problem is in the hdd and how I copied the file.
I am curious of what I did wrong ? One solution is to restart from beginning and follow the documentation, but if I can avoid this.

I will check the formatting, but I should have done this correctly also :thinking:

Just out of curiosity i did this:

$ lsblk

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0  1.8T  0 disk 
└─sda1        8:1    0  1.8T  0 part 
mmcblk0     179:0    0 58.9G  0 disk 
├─mmcblk0p1 179:1    0  512M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 58.4G  0 part /

Which look similar to the starting point of the tutorial. I suppose it means, I didn’t succeeded ?

Still, some kind of progress :wink:

So,

  • After uncommenting the ‘root’ line in fstab :
    • no access via SSH
    • Yunohost will boot?
  • After comenting out the /mnt/hdd line and both bind lines:
    • Yunohost does boot
    • Access via web and SSH works
  • but
    • this way you have nothing in /home (it is in /home.bkp and you have nothing in /var/mail (it is in /var/mail.bkp)
    • maybe some programs recreate the directories under /home and /var/mail, confusing matters. Will you check?

The /mnt/hdd line in fstab should not hurt: it just makes things available, but does not activate anything. Will you try uncommenting that one and see if things still work, also after rebooting?

After the reboot, see that you can log in via SSH and that your stuff is indeed available under /mnt/hdd/home and /mnt/hdd/var/mail.

Copying was done cp -a, to preserve ownership and permissions; your log shows correct ownership at least directory level.

Now, without changing fstab, mount --bind /mnt/hdd/var/mail /var/mail. See that it is mounted and ls to verify contents.

Using a new terminal, make a second connection to your Yunohost to verify that SSH still works, or open a new tab to the web interface in your browser.

After that the same, but for the home directory. If anything makes stuff break, I suspect it is the home directories, because your user does not have a place to ‘come home’ when logging in.

If anything breaks after either mount --bind commands, you can reboot, because we didn’t make the change persist in fstab. If things keep working, enable first the mail line in fstab and then home.

Finally, if for one reason or another, things already stop working after enabling the /mnt/hdd line in fstdab, you might try using /dev/sdb1 instead of UUID="5c55..."

So, summarizing once again:

  • first uncomment the /mnt/hdd line in fstab
    • check that everything still works, also after reboot
    • if it does not, try the /dev/sdb1 notation instead of UUID
  • once booting with /mnt/hdd (one way or another) active in fstab works
    • bind mount /var/mail manually without changes in fstab, check that things work
    • bind mount /home manually without changes in fstab, check that things work
  • things keep working with manual bind mount?
    • change fstab to enable /var/mail, check working
    • change fstab to enable /home, check working

Good luck!

Thanks it worked!

I am unsure how :sweat_smile:, as every step you advised me to do didn’t raise any error or warning.

But with the last ssh I have this output

lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0  1.8T  0 disk 
└─sda1        8:1    0  1.8T  0 part /home
                                     /var/mail
                                     /mnt/hdd
mmcblk0     179:0    0 58.9G  0 disk 
├─mmcblk0p1 179:1    0  512M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 58.4G  0 part /

I hope now everything is set for me to use my server correctly (without breaking it hehe).

I just need to fix, that i can’t acces my server on my linux computer (works on my windows and android however)

1 Like

Great :slight_smile:

Looks as it should! Good that you didn’t need to take the UUID-notation away: I now see that the HDD is /dev/sda, with the root partition on /dev/mmcblk0 :stuck_out_tongue:

That would be a topic for another thread. If it used to work before, you could look into fail2ban. One way is to grep 'Ban ' /var/log/fail2ban.log* (or write your laptop’s IP instead of Ban).

Looks as it should! Good that you didn’t need to take the UUID-notation away: I now see that the HDD is /dev/sda, with the root partition on /dev/mmcblk0 :stuck_out_tongue:

It used to be sdb when i started all the process :melting_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.