× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Readynas 424 SSH service not starting (no error)

mdgm
Virtuoso

Re: Readynas 424 SSH service not starting (no error)

So it looks like /dev/sdc isn't a hard disk at all, but rather something else e.g. internal flash or a USB key, so the error message about sdc can be ignored.

You can do e.g.

# ls -la /dev/disk/internal

to list the internal disks (note the path to the disk may change so you shouldn't rely on the list obtained from a previous boot).

 

For future reference (not needed now as the RAID is already started) you can modify a command like 

mdadm --assemble /dev/md0 /dev/sd[a-z]1

to

mdadm --assemble /dev/md0 /dev/sd[a-b]1

If you want if you know the disks are just a and b. However if the disks were a, b and d for example you'd still have to have a command that looks at something that isn't a hard disk if you want to keep the command as short as possible to type.

When you are looking at problems multiple times a day you can get into the habit of copying and pasting regularly used commands which is why we use commands written in a way where they will hopefully work with every system regardless of the disk configuration.


You should be able to proceed to check the services file has the correct entries and that the symlink exists.

Message 26 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

/Facepalm

I can't believe I missed that I still had an old USB plugged in to the back, I had completely forgot about. Thanks!

 

Now for the mounting of the sysroot, trying Rn_Enthusiast's commands (after exiting out of chroot using ^d), and #mdadm --assemble /dev/md0 /dev/sd[a-b]1

results in

mdadm: /dev/sda1 is busy - skipping
mdadm: /dev/sdb1 is busy - skipping

#cat /proc/mdstat

shows

Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md1 : active raid1 sda2[0] sdb2[1]
      523264 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sdb1[0] sda1[1]
      4190208 blocks super 1.2 [2/2] [UU]

# mount /dev/md0 /sysroot 

results in

mount: mounting /dev/md0 on /sysroot failed: Device or resource busy

plain old #mount

shows

rootfs on / type rootfs (rw,size=999996k,nr_inodes=249999)
proc on /proc type proc (rw,noatime,nodiratime)
sysfs on /sys type sysfs (rw,noatime,nodiratime)
udev on /dev type devtmpfs (rw,noatime,nodiratime,size=10240k,nr_inodes=250004,mode=755)
devpts on /dev/pts type devpts (rw,noatime,nodiratime,mode=600,ptmxmode=000)
/dev/md0 on /sysroot type btrfs (rw,noatime,nodiratime,nospace_cache,subvolid=5,subvol=/)




Message 27 of 43
mdgm
Virtuoso

Re: Readynas 424 SSH service not starting (no error)

One would have expected that the system would have been smart enough to realise that it should ignore sdc and start the RAID anyway, but it didn't in this case. Doing the rnutil chroot started the RAID.

 

What's more the rnutil chroot command also mounts /dev/md0 to /sysroot as you have observed.

 

So it's a handy command to quickly start all the RAID arrays, mount the 4GB root volume and chroot onto it. This is nice but if there's a problem with the RAID or a disk it can be advisable to proceed in a more cautious way entering the commands for the different steps manually.

Message 28 of 43
rn_enthusiast
Virtuoso

Re: Readynas 424 SSH service not starting (no error)

Yea /dev/sdc isn't a raid disk but mdadm tried to use it in the raid assembly. So, that is why it complained. It is fine but mdadm should be more clever here and I expected it would be. Anyway...

 

By running rnutil chroot, the NAS started the raids, mounted to OS and chroot'ed you into the OS. This changes things slightly because you are chroot'ed into the OS now.

 

Steps to take now:

 

Now, use "vi" editor to change the default services file in order to enable SSH.

vi /etc/default/services

 

Find these 5 lines in the file and change them to the same values as per below.

SSH=1
SSHPORT=22
SSH_UI_ENABLE=1
REMOTE_ACCESS_SSH_PORT=0
SSH_PASSWORD_AUTHENTICATION=1 

Save the changes and exit the "vi" editor.

 

Exit out of chroot.

exit

Un-mount the OS partition

umount /sysroot

 

Stop all running raids:

mdadm --stop /dev/md*

 

Check that the raids are stopped:

cat /proc/mdstat

 

Flush memory to disk and reboot the NAS:

sync
reboot -fn

 

Message 29 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

Alright, thanks a tonne, I've learned a fair bit here.

 

As for the issue, when I went into the default services file, I found that 

 

the values that were suggested by rn_enthusiast were already what was listed, I exited vi umounted, mdadm stopped, rebooted, tried to ssh, no luck, the readynas webpage still shows ssh as being disabled.

Message 30 of 43
mdgm
Virtuoso

Re: Readynas 424 SSH service not starting (no error)

Checking that the symlink I mentioned in an earlier post is there is probably what I would check next.

ln -s /lib/systemd/system/ssh.service /sysroot/etc/systemd/system/multi-user.target.wants/ssh.service

or inside the chroot

 

 

ln -s /lib/systemd/system/ssh.service /etc/systemd/system/multi-user.target.wants/ssh.service

After that there's things like checking logs, checking the management service database and comparing SSH configuration files with a working ReadyNAS system or a OS6 Virtual Machine, comparing debian package versions with a working machine running the same firmware and probably other things as well that escape my memory at the moment.

 

Message 31 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

Thanks again, looks like after mounting the system again using mdadm (it all went smoothly this time)

 

your first command 

ln -s /lib/systemd/system/ssh.service /sysroot/etc/systemd/system/multi-user.target.wants/ssh.service

results in 

ln: /sysroot/etc/systemd/system/multi-user.target.wants/ssh.service: File exists
Message 32 of 43
StephenB
Guru

Re: Readynas 424 SSH service not starting (no error)

Does it look like this?

root@NAS:/etc/systemd/system/multi-user.target.wants# cat ssh.service
[Unit]
Description=SSH Server
Wants=ssh-avahi.service
After=network.target

[Service]
ExecStart=/usr/sbin/sshd -D
KillMode=process
Restart=always

[Install]
WantedBy=multi-user.target

Also, if you have a log zip file, can you check systemd-journal.log for errors related to ssh and sshd?

 

If you've done the chroot, I think you could try manually starting the service, and see what happens.

# systemctl start ssh.service

 

 

 

Message 33 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

Sorry for the long wait, life got in the way as usual, so last night, my router started not connecting to Ethernet devices and after trial and error I discovered that the NAS was causing the issue, whenever the nas is connected to my router, all wired devices cease connection, is the nas flooding dhcp requests or is something else happening? I’m close to giving up on this device, Synology looks nice.
Message 34 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

I just noticed something that may be a coincidence or may not be, but this took place exactly 2 months after I began to have issues, to the day, is there any services on the nas that like to reboot themselves after 2 months?
Message 35 of 43
mdgm
Virtuoso

Re: Readynas 424 SSH service not starting (no error)

One wonders whether the unit has been hacked (did you forward ports to the device?) or something you did using SSH is causing problems. Can only guess without looking at the unit.

Message 36 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

I highly doubt it's been hacked, there's nothing of value on there, there's a plex media server and 2 ports forwarded to it, not a single password is default, and none of them are duplicated, it's far more likely I've screwed something up, but since ssh stopped working I haven't done anything except for maintain the plex server, I have no access to the backend, and starting the service manually doesn't work, why is there no way to just re-install the root partition without losing data in seperate folders? I understand this is most likely my fault, but on the same token, not having a sanitized data partition that is completely seperate from the OS seems like an oversight.

 

Edit: p.s. restarting the NAS and plugging it into a switch fixed the dhcp flood (I assume) issue for now, if it reappears I'm switching to synology, at least I'll have access to SSH.

Message 37 of 43
StephenB
Guru

Re: Readynas 424 SSH service not starting (no error)


@Killerjerick wrote:

plugging it into a switch fixed the dhcp flood (I assume) issue for now,


That's a bit odd.

 

Are you only using one of the NIC ports of the NAS?

 

Did you see specific evidence of a DHCP flood, or are you just guessing that was the root cause?

 

Also, was this a managed switch that has storm control enabled, or an unmanaged switch (which likely wouldn't).

 

If you move the ethernet cable back to the router does the problem start up again?  Or does the router remain working?

Message 38 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

Hi all, sorry for being absent for so long, life has been busy, I've still not fixed this issue and it has been 240 days since I last had SSH access to my RN424, this is less than ideal as a number of apps I and others use frequently are needing updates, which is impossible without SSH access... I briefly considered Netgear support, but don't want to shell out the crazy amount they are trying to charge only for them to suggest a factory reset, I need to backup a few pieces of data before doing that and I have 12tb of media that isn't too important but I'd prefer to not have to re upload to the box.

 

If anyone is aware of a way to just reinstall the OS without affecting the user/apps directory, please let me know.

 

Thank you

Message 39 of 43
Sandshark
Sensei

Re: Readynas 424 SSH service not starting (no error)

An OS re-install from thew boot menu does exactly that, at least if the apps are written right.  Just be careful not to accidently do a Factory Default, which will want to wipe your data.

 

As a precaution, you can save the NAS configuration.  In that zip file will be all the .conf files so you can compare them against the post-reinstall versions if something seems to have broken.

Message 40 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

Hmm, then we have a problem because I'm sure I did exactly that before, nonetheless, I'll try it again, thank you.

Message 41 of 43
Killerjerick
Aspirant

Re: Readynas 424 SSH service not starting (no error)

Yes indeed, an OS Re-install did NOT fix the issue, honestly no idea what is wrong with this thing, if I end up getting it working again, I'll be backing up daily, I didn't realise something could cause non-functionality like this.

Message 42 of 43
mdgm
Virtuoso

Re: Readynas 424 SSH service not starting (no error)

An OS Re-install extracts the OS over the top of the existing installation and resets some settings and fixes some other common issues. It's not designed to handle problems that relate to things that a user may have done using SSH though.

Message 43 of 43
Top Contributors
Discussion stats
  • 42 replies
  • 5373 views
  • 21 kudos
  • 5 in conversation
Announcements