Manual FreeBSD Rescue System/en

Aus EUserv Wiki

Version vom 10:05, 26. Nov. 2015 bei Svtr1 (Diskussion | Beiträge)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Using the FreeBSD Rescue system

Inhaltsverzeichnis

Using the FreeBSD Rescue system

Activating the FreeBSD Rescue system

You have to activate the FreeBSD Rescue system via the customer control panel. The following wiki guide shows you how to activate the FreeBSD Rescue system:

Activate the Rescue system


Connecting to the FreeBSD Rescue system

After the activation you can connect with the FreeBSD Rescue system. Please proceed as follows:

  • Open an SSH program (e.g. Putty)
  • Enter the IP address of your server and port 22.
  • Enter your username and password. Please enter root and the default password of your server. Information on where you can find these data can be obtained here: here


Resetting the root password

Preparation

Please proceed as follows to change the root password:

  • Enter your installed system in a chroot environment (replace X with the relevant partition number):
mount /dev/ada0pX /mnt
cd /mnt
chroot .


Implementation

  • Enter the following command as root:
 passwd
  • Enter the new password.
  • Enter the new password again.
  • Exit the chroot environment and unmount the partitions:
exit
cd ..
umount mnt
  • Deactivate the Rescue system via the customer control panel.
  • Perform a web reset via the customer control panel.

You have successfully changed the root password. You can now connect to your system with the newly assigned password.

Mounting of OpenBSD partitions

OpenBSD filesystems (FFS) can also be mounted under FreeBSD.

Preparation

You have to connect to the FreeBSD Rescue system in order to mount OpenBSD partitions. Please proceed as follows:

  • Activate the Rescue system via the customer control panel.
  • Connect to the Rescue system via SSH.

Implementation

Mounting OpenBSD partitions can be done after an fsck is performed. Enter the following command:

 fsck -t ffs /dev/adaXsY 

Replace X with the hard disk drive and Y with the partition you want to mount.


Disabling the firewall

Preparation

Please proceed as follows to disable the firewall:

  • Enter your installed system in a chroot environment (replace X with the relevant partition number):
mount /dev/ada0pX /mnt
cd /mnt
chroot .


Implementation

Open the file /etc/rc.conf with the following command:

 nano /etc/rc.conf

If you use the "pf" firewall, add the following line:

 pf_enable="NO"


Checking / Restoring a faulty filesystem

Checking / Restoring a filesystem of a physical hard disk drive

In order to check the filesystem of a physical hard disk drive you have to connect with the FreeBSD Rescue system. Please proceed as follows:

  • Activate the Rescue system via the customer control panel.
  • Connect to the Rescue system via SSH.

Enter the following command to start the check of the filesystem (Replace X with the relevant partition):

 fsck /dev/ada0pX

fsck performs checks and repairs of a FreeBSD file system.

Important: Don't run fsck on a mounted filesystem!


Checking the filesystem of a software RAID

In order to check the filesystem of a software RAID you have to connect with the FreeBSD Rescue system. Please proceed as follows:

  • Activate the Rescue system via the customer control panel.
  • Connect to the Rescue system via SSH.

Enter the following command to start the check of the filesystem (Replace X with the relevant partition):

 fsck /dev/gmX

fsck performs checking and repairing of a FreeBSD file system.

Important: Don't run fsck on a mounted filesystem!

Checking the hard disk drives

Hard disk check with smartctl / smartmontools

In order to check the hard disk drives you have to connect with the FreeBSD Rescue system. Please proceed as follows:

  • Activate the Rescue system via the customer control panel.
  • Connect to the Rescue system via SSH.
  • Enter your installed system in a chroot environment (replace X with the relevant partition number):
mount /dev/ada0pX /mnt
cd /mnt
chroot .


Hard disk check with smartctl / smartmontools for normal hard disks

Please proceed as follows in order to check your hard disk drives with smartmontools:

  • Start a short hard disk drive check with the following command (Replace X with the relevant hard disk drive):
 smartctl -t short /dev/adaX
  • Start a long hard disk drive check with the following command (Replace X with the relevant hard disk drive):
 smartctl -t long /dev/adaX


Hard disk check with smartctl / smartmontools for hard disk drives on hardware RAID controllers

In order to perform a short check for hard disk drives on 3ware hardware RAID controllers please proceed as follows:

  • Enter the following command to start a short test (Replace X with the number of the relevant controller port on which the hard disk drive is connected. Please notice: The first hard disk drive is connected on port 0.):
 smartctl -d 3ware,X -t short /dev/twa0
  • Enter the following command to start a long test:
 smartctl -d 3ware,X -t long /dev/twa0


Evaluation of the results

Enter the following command to display the results of the hard disk drive tests:

 smartctl -l selftest /dev/adaX

The following output example shows that the hard disk drive health is ok:

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      4970         
# 2  Long offline        Completed without error       00%      4972

The following output example shows that the hard disk drive health is not ok ("read failure"):

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       20%       717         555027747


Reporting errors to the support

Reporting errors of normal hard disk drives

In order to report errors of the hard disk drive to the support, please specify the output of the following command:

 smartctl -a /dev/adaX


Reporting errors of hard disk drives behind hardware RAID controllers

In order to report errors of the hard disk drive on 3ware RAID controllers to the support, please specify the output of the following command (Replace X with the number of the relevant controller port on which the hard disk drive is connected.):

 smartctl -d 3ware,X -a /dev/twa0


Hardware RAID

Basics / General information

Checking the status of the controller

In order to check the status of 3ware RAID controllers, you have to be connected with the FreeBSD Rescue system. Please proceed as follows:

  • Activate the Rescue system via the customer control panel:
  • Connect to the Rescue system via SSH.
  • Enter your installed system in a chroot environment (replace X with the relevant partition number):
mount /dev/ada0pX /mnt
cd /mnt
chroot .


  • Enter the following command to identify the ID of the controller (usually it is 0):
 dmesg | grep 3ware

The following output is displayed (the controller ID is the number after scsi):

 [    5.487015] scsi4 : 3ware 9000 Storage Controller
  • Enter the following command to read the hardware RAID controller information (Replace X with the relevant controller ID):
 tw_cli /cX show

The following example output is possible:

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-1    OK             -       -       -       149.001   RiW    ON     

VPort Status         Unit Size      Type  Phy Encl-Slot    Model
------------------------------------------------------------------------------
p0    OK             u0   149.05 GB SATA  0   -            SAMSUNG HD160JJ     
p1    OK             u0   149.05 GB SATA  1   -            SAMSUNG HD160JJ    

In this case the RAID is in a perfect condition.

Unit UnitType Status  %RCmpl  %V/I/M Port Stripe Size(GB)


u0 RAID-1 REBUILDING 23% - - - 149.001 u0-0 DISK DEGRADED - - p0 - 149.001 u0-1 DISK OK - - p1 - 149.001 u0/v0 Volume - - - - - 149.001

In this case the RAID performs a rebuild. The faulty hard disk drive is the one that is connected on port 0.


Checking the status of the hard disk drives

In order to start a check of hard disk drives behind 3ware RAID controllers with smartmontools, please proceed as follows:

  • Enter the following command to start a short test (Replace X with the relevant controller port, on which the hard disk drive is connected. Please note that the first hard disk drive is connected on port 0):
 smartctl -d 3ware,X -a /dev/twa0


Reporting errors to the support

In order to report errors of your hard disk drive behind a 3ware RAID controller to the support specify the output of the following command:

 smartctl -d 3ware,X -a /dev/twa0

Checking the RAM

In order to perform a check of the server's memory the memtester utility can be used. It's available on the EUserv mirror and can be obtained from the following link:

http://mirror.euserv.net/misc/memtester.tar.gz


To perform the check, please proceed as follows:

  • Activate the Rescue system via the customer control panel:
  • Connect to the Rescue system via SSH.
  • Enter your installed system in a chroot environment (replace X with the relevant partition number):
mount /dev/ada0pX /mnt
cd /mnt
chroot .
  • Download memtester. Use the following command:
fetch http://mirror.euserv.net/misc/memtester.tar.gz
  • Extract the archive. Use the following command:
tar xfz memtester.tar.gz
  • Change to the extracted directory. Use the following command:
cd memtester
  • Compile the program. Use the following command:
make

Now you can execute the program with the following pattern:

./make <Amount of memory> <Passes>


The amount of memory can be determined with the command grep memory /var/run/dmesg.boot. Alternatively you may use the vmstat command. The respective value can be found under the real memory column.


Example:

real memory  = 34359738368 (32768 MB)
avail memory = 33112584192 (31578 MB)

In order to check the memory two times in a row you can use the following command:

./memtester 32768 2