Skip to content

Commit

Permalink
Merge branch 'rockstor:master' into 358_special_install_scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Hooverdan96 authored Oct 25, 2024
2 parents f3ca213 + 2d33db1 commit d27a49e
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 47 deletions.
6 changes: 5 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@
# -- Options for linkcheck ------------------------------------------------
linkcheck_retries = 2
linkcheck_timeout = 20
linkcheck_ignore = [r'https://web.libera.chat/#btrfs']
linkcheck_ignore = [r'https://web.libera.chat/#btrfs',
r'https://ark.intel.com/',
r'https://opensource.org/license/mit-0',
r'https://opensource.org/license/apache-2-0'
]

# -- Options for sphinxext.rediraffe --------------------------------------
rediraffe_redirects = "redirects.txt"
Expand Down
1 change: 1 addition & 0 deletions howtos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ How-tos & Guides
howtos/soho
howtos/kvm_setup
howtos/reset-root-password
howtos/reset-root-password-v3
howtos/windows-shadow-copy
howtos/multi_period_snapshots
howtos/rufus_howto
Expand Down
86 changes: 86 additions & 0 deletions howtos/reset-root-password-v3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

.. _rootpwreset_legacy:

Resetting root password on Rockstor Legacy V3.x
===============================================

.. warning::
Rockstor version 3.x built on CentOS has been deprecated. Please see
:ref:`rootpwreset` for the newer version of this document based on
OpenSUSE.

The **root** user is created during Rockstor OS install. You may remember setting root
password in one of the install screens. After a while, it's possible that you
forgot the password and would like to reset it. To do that is a straight
forward process as described in this howto.


Step 1: Boot up with install CD/DVD/USB-drive
---------------------------------------------

Resetting password requires shutting down the system and booting it up with
Rockstor install CD/DVD or USB-drive as you have done it during install. If you
are unsure, see :ref:`osinstall`.

On the splash screen, scroll down to **Troubleshooting** and hit enter to go to
the Troubleshooting screen.

.. image:: /images/howtos/reset-root-password/splash_screen.png
:scale: 80%
:align: center

Step 2: Go to Rescue Shell
--------------------------

In the **Troubleshooting** screen, scroll down to **Rescue and Rockstor
System** and hit enter to go to the **Rescue** screen.

.. image:: /images/howtos/reset-root-password/troubleshooting_screen.png
:scale: 80%
:align: center

In the **Rescue** screen, use the Tab key to highlight the **Continue** button
and hit enter.

.. image:: /images/howtos/reset-root-password/rescue_screen.png
:scale: 80%
:align: center

Hit Enter key again on the next two screens to be dropped into the Shell.

.. image:: /images/howtos/reset-root-password/rescue_shell.png
:scale: 80%
:align: center

Step 3: Reset password
----------------------

Once you are in the rescue shell, change the filesystem root ::

sh-4.2# chroot /mnt/sysimage

Now change the password with the *passwd* command ::

bash-4.2# passwd

Remove autorelabel file ::

bash-4.2# rm -f /.autorelabel

Get out of chroot with the exit command ::

bash-4.2# exit

Here's an example image showing execution of above commands.

.. image:: /images/howtos/reset-root-password/reset_pw_commands.png
:scale: 80%
:align: center

Enter *exit* command again and the system will reboot ::

sh-4.2# exit

Remove the install CD/DVD or USB-drive and let the system boot up
completely. You can now login at the terminal and SSH as root using the new
password.
139 changes: 93 additions & 46 deletions howtos/reset-root-password.rst
Original file line number Diff line number Diff line change
@@ -1,81 +1,128 @@

.. _rootpwreset:

Resetting root password
Reset the root password
=======================

root user is created during Rockstor OS install. You may remember setting root
password in one of the install screens. After a while, it's possible that you
forgot the password and would like to reset it. To do that is a straight
forward process as described in this howto.
The **root** user is created during the Rockstor installation. During one of the
installation steps the root password was set (and confirmed).
After a while, it's conceivably possible that the password information is
lost and needs to be reset. The Rockstor installation media does not contain
a rescue environment anymore, due to install media size concerns. Therefore,
a separate rescue disk needs to be downloaded (less than 1 GB in size).

The disk image can be obtained from openSUSEs repositories for the different releases:

Step 1: Boot up with install CD/DVD/USB-drive
---------------------------------------------
* `Leap 15.5 <https://download.opensuse.org/distribution/leap/15.5/live/>`_
* `Leap 15.6 <https://download.opensuse.org/distribution/leap/15.6/live/>`_
* `Tumbleweed <https://download.opensuse.org/tumbleweed/iso/>`_
(only available for x86_64 architecture)

Resetting password requires shutting down the system and booting it up with
Rockstor install CD/DVD or USB-drive as you have done it during install. If you
are unsure, see :ref:`osinstall`.
In order to quickly narrow down the search, the Search function in the top left can
be used. Entering the terms **Rescue** followed by the architecture **x86_64** or **aarch64**
should narrow this down to the relevant image that can then be downloaded. Unfortunately,
there is no ready image for a Pi architecture:

On the splash screen, scroll down to **Troubleshooting** and hit enter to go to
the Troubleshooting screen.

.. image:: /images/howtos/reset-root-password/splash_screen.png
:scale: 80%
.. image:: /images/howtos/reset-root-password/pw01_search_rescue_disk.png
:scale: 100%
:align: center

The downloaded image needs to be used to create bootable media, on a USB stick,
CD-ROM/DVD disk, or, if using Rockstor on a virtual machine, the downloaded
*iso* file can be mounted directly. For USB one can use the same approach
described for :ref:`makeusbinstalldisk`.

Step 2: Go to Rescue Shell
--------------------------
Once that's completed, below are the instructions:

In the **Troubleshooting** screen, scroll down to **Rescue and Rockstor
System** and hit enter to go to the **Rescue** screen.

.. image:: /images/howtos/reset-root-password/troubleshooting_screen.png
:scale: 80%
Step 1: Boot up with an OpenSUSE rescue CD
------------------------------------------

To reset the password shut down the Rockstor system and boot it up with
the above created rescue media. Like with the original Rockstor installation,
it might require to adjust the boot device sequence (in the BIOS, or, if
available, during the boot process by pressing Function Keys like **<F12>**,
depending on the motherboard manufacturer).

On the splash screen, select the **Failsafe** option and hit <Enter>. This will
boot the system into the command line. If, by accident, it boots into the first
option with a graphical UI, either reset the machine and try again, or attempt to
open a terminal window on the desktop and proceed from there with the command
line-based process.

.. image:: /images/howtos/reset-root-password/pw01_splash_screen.png
:scale: 50%
:align: center

In the **Rescue** screen, use the Tab key to highlight the **Continue** button
and hit enter.

.. image:: /images/howtos/reset-root-password/rescue_screen.png
Step 2: Log in and mount relevant devices and partitions
--------------------------------------------------------

After the boot completes the login prompt should appear (the screenshot
is from a virtual machine, hence the *vbox* login). Right above the network
interfaces are listed, though they won't be needed for this activity.

.. image:: /images/howtos/reset-root-password/pw01_rescue_shell.png
:scale: 80%
:align: center

Hit Enter key again on the next two screens to be dropped into the Shell.
To log into the system, just type :code:`root` for the user and hit <Enter>.
Now that the login is complete, a device and a few partitions need to be
mounted for the password reset to work.

First, identify the device that houses the Rockstor Operating System, using:

.. image:: /images/howtos/reset-root-password/rescue_shell.png
.. code-block: console
lsblk
to identify all devices connected to the machine, and then, identify
the one that's the system device (likely the one that has the smallest size).
Here is a sample output, it will look different on every user's machine:

.. image:: /images/howtos/reset-root-password/pw01_lsblk_output.png
:scale: 80%
:align: center

Step 3: Reset password
----------------------

Once you are in the rescue shell, change the filesystem root ::
In the above example **/dev/sda4** is the system device (largest partition on
*sda*).

sh-4.2# chroot /mnt/sysimage
Next mount that device:

Now change the password with the *passwd* command ::
.. code-block: console
vbox:~# mount -o rw /dev/sda4 /mnt
Then create a few bind mounts, change the filesystem root directory for the
running process and finally mount these, so that the system can use them
for the next step:

bash-4.2# passwd
.. code-block:: console
vbox:~# mount -o bind /proc /mnt/proc
vbox:~# mount -o bind /sys /mnt/sys
vbox:~# mount -o bind /dev /mnt/dev
vbox:~# chroot /mnt
vbox:~# mount -a
Remove autorelabel file ::
Step 3: Reset password
----------------------

bash-4.2# rm -f /.autorelabel
Now change the password with the *passwd* command:

Get out of chroot with the exit command ::
.. code-block:: console
bash-4.2# exit
vbox:~# passwd
Here's an example image showing execution of above commands.
Enter the new password. The system will ask for confirmation
through retyping it. Then the new password is set.

.. image:: /images/howtos/reset-root-password/reset_pw_commands.png
:scale: 80%
:align: center
Get out of chroot with the exit command:

Enter *exit* command again and the system will reboot ::
.. code-block:: console
vbox:~# exit
sh-4.2# exit
Shut down the system and remove the rescue disk.

Remove the install CD/DVD or USB-drive and let the system boot up
completely. You can now login at the terminal and SSH as root using the new
password.
Boot the system back up and a login using the root password should
once again be possible.
3 changes: 3 additions & 0 deletions howtos/v3_to_v4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ So, if your prior v3 install had a customization involving a CentOS/RHEL compati
you should now, in v4, look first for an openSUSE equivalent and then for a SLES equivalent.
This is most likely only going to affect advanced users and is not a concern for mainly Web-UI users.


.. _Users_default_groups:

Users and default group
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions interface/storage/disks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ The BTRFS Pool import procedure imports the following:-
This process is detailed in the following sub-sections: :ref:`btrfsdisk`, and
:ref:`btrfspartition`.

.. warning::

During the pool import sometimes the imported shares' ownership for user and group
can revert back to the default `root:root`. Before proceeding with any other
activities, for example a Rockstor system restore using a previously
generated configuration backup file, ensure that the respective share
user/group ownerships are set back to what they were before they were
imported into the Rockstor installation. For how OpenSUSE handles default user
and group assignment see :ref:`Users_default_groups`.



.. _btrfsdisk:

Import whole disk BTRFS
Expand Down

0 comments on commit d27a49e

Please sign in to comment.