How to Connect to Your VDS Server via SSH (Complete Guide)
Step-by-step SSH connection guide for Linux VDS: PuTTY, Terminal, key-based authentication, Path Panel firewall rules, and security best practices.
RAID levels overview (0/1/5/10), software RAID with mdadm, disk health checks with smartctl, monitoring with smartd, and interpreting SMART data.
Disk failures are inevitable in server environments. RAID (Redundant Array of Independent Disks) technology combines multiple disks to improve data safety and/or performance. This guide covers RAID levels, software RAID setup on Linux, and disk health monitoring with smartctl.
Data is distributed equally across disks.
Data is written to all disks simultaneously.
Data and parity information are distributed across all disks.
Combination of RAID 1 and RAID 0.
| Feature | RAID 0 | RAID 1 | RAID 5 | RAID 10 |
|---|---|---|---|---|
| Min. disks | 2 | 2 | 3 | 4 |
| Capacity | 100% | 50% | (N-1)/N% | 50% |
| Read speed | Very high | High | High | Very high |
| Write speed | Very high | Normal | Moderate | High |
| Fault tolerance | 0 disks | 1 disk | 1 disk | 1/pair |
| Data safety | None | High | High | Very high |
REXE physical servers may have a hardware RAID controller. Software RAID is managed by the Linux kernel as an alternative to hardware RAID.
# Ubuntu/Debian
sudo apt update
sudo apt install mdadm -y
# CentOS/AlmaLinux
sudo dnf install mdadm -y
# List existing disks
lsblk
fdisk -l
# View disk information
sudo fdisk -l /dev/sdb
sudo fdisk -l /dev/sdc
# Clear existing RAID signatures if present
sudo mdadm --zero-superblock /dev/sdb
sudo mdadm --zero-superblock /dev/sdc
# Create RAID 1 array
sudo mdadm --create /dev/md0 \
--level=1 \
--raid-devices=2 \
/dev/sdb /dev/sdc
# Confirm creation (type yes)
# Monitor RAID status
watch cat /proc/mdstat
# Check completion status
cat /proc/mdstat
# Create RAID 5 array (3 disks)
sudo mdadm --create /dev/md0 \
--level=5 \
--raid-devices=3 \
/dev/sdb /dev/sdc /dev/sdd
# Add a hot spare disk
sudo mdadm --create /dev/md0 \
--level=5 \
--raid-devices=3 \
--spare-devices=1 \
/dev/sdb /dev/sdc /dev/sdd /dev/sde
# Update mdadm.conf
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
# Update initramfs
sudo update-initramfs -u
# View RAID status
sudo mdadm --detail /dev/md0
# Create ext4 filesystem
sudo mkfs.ext4 /dev/md0
# Create mount point
sudo mkdir /mnt/raid
# Mount
sudo mount /dev/md0 /mnt/raid
# Add to /etc/fstab for persistent mounting
echo '/dev/md0 /mnt/raid ext4 defaults 0 0' | sudo tee -a /etc/fstab
# View RAID status
sudo mdadm --detail /dev/md0
# List all RAID arrays
cat /proc/mdstat
# Mark a disk as failed
sudo mdadm /dev/md0 --fail /dev/sdb
# Remove failed disk
sudo mdadm /dev/md0 --remove /dev/sdb
# Add new disk
sudo mdadm /dev/md0 --add /dev/sdb
# Stop RAID
sudo mdadm --stop /dev/md0
# Start RAID
sudo mdadm --assemble /dev/md0
smartctl reads S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) data from disks.
# Ubuntu/Debian
sudo apt install smartmontools -y
# CentOS/AlmaLinux
sudo dnf install smartmontools -y
# View disk information
sudo smartctl -i /dev/sda
# Check SMART status
sudo smartctl -H /dev/sda
# Output: SMART overall-health self-assessment test result: PASSED
# View all SMART data
sudo smartctl -a /dev/sda
# Short summary
sudo smartctl -s on -a /dev/sda
# Short test (1-2 minutes)
sudo smartctl -t short /dev/sda
# Long test (several hours)
sudo smartctl -t long /dev/sda
# View test results
sudo smartctl -l selftest /dev/sda
# Check test progress
sudo smartctl -a /dev/sda | grep -i "test"
Important SMART attributes:
# View attributes
sudo smartctl -A /dev/sda
| ID | Attribute | Description | Critical Value |
|---|---|---|---|
| 1 | Raw_Read_Error_Rate | Raw read error rate | Should be 0 |
| 5 | Reallocated_Sector_Ct | Reallocated sector count | Should be 0 |
| 9 | Power_On_Hours | Total operating hours | Informational |
| 10 | Spin_Retry_Count | Spin retry count | Should be 0 |
| 187 | Reported_Uncorrect | Uncorrectable error count | Should be 0 |
| 188 | Command_Timeout | Command timeout count | Should be 0 |
| 197 | Current_Pending_Sector | Pending sector count | Should be 0 |
| 198 | Offline_Uncorrectable | Offline uncorrectable | Should be 0 |
| 199 | UDMA_CRC_Error_Count | CRC error count | Should be 0 |
If ID 5 (Reallocated_Sector_Ct), 197 (Current_Pending_Sector), or 198 (Offline_Uncorrectable) values are greater than 0, the disk may be near failure. Back up your data immediately!
# NVMe disk information
sudo smartctl -i /dev/nvme0
# NVMe SMART data
sudo smartctl -a /dev/nvme0
# NVMe health status
sudo smartctl -H /dev/nvme0
smartd runs in the background, continuously monitoring disk health and sending notifications when issues are detected.
# Edit configuration file
sudo nano /etc/smartd.conf
# Monitor all disks, send email on issues
DEFAULTS -a -o on -S on -n standby,q -s (S/../.././02|L/../../6/03) -m admin@rexe.tr -M exec /usr/share/smartmontools/smartd-runner
# Monitor specific disks
/dev/sda -a -o on -S on -m admin@rexe.tr
/dev/sdb -a -o on -S on -m admin@rexe.tr
# Auto-detect all disks
DEVICESCAN -a -o on -S on -m admin@rexe.tr
# Enable smartd service
sudo systemctl enable --now smartd
# Check status
sudo systemctl status smartd
# Test configuration
sudo smartd -q onecheck
| Option | Description |
|---|---|
-a | Monitor all SMART attributes |
-o on | Enable offline tests |
-S on | Enable attribute saving |
-s S/../.././02 | Run short test daily at 02:00 |
-s L/../../6/03 | Run long test every Saturday at 03:00 |
-m email | Notification email |
-n standby,q | Don't wake standby disks |
# Quick health check for all disks
for disk in /dev/sd[a-z]; do
echo "=== $disk ==="
sudo smartctl -H $disk 2>/dev/null | grep -E "PASSED|FAILED|result"
done
# Check disk temperature
sudo smartctl -A /dev/sda | grep -i temperature
# Check disk operating hours
sudo smartctl -A /dev/sda | grep Power_On_Hours
# View error logs
sudo smartctl -l error /dev/sda
# Get disk info in JSON format
sudo smartctl -j -a /dev/sda
# Check SMART status of disks in RAID array
sudo mdadm --detail /dev/md0 | grep -E "State|Active|Failed"
# Check health of each disk in RAID
for disk in /dev/sdb /dev/sdc /dev/sdd; do
echo "=== $disk ==="
sudo smartctl -H $disk
done
# Monitor RAID events
sudo mdadm --monitor --scan --daemonise
# RAID email notification
sudo nano /etc/mdadm/mdadm.conf
# Add line: MAILADDR admin@rexe.tr
Use RAID and SMART monitoring together. SMART predicts disk failure in advance while RAID prevents data loss when failure occurs. Together they form a comprehensive disk safety strategy.
RAID and disk health monitoring are fundamental components of data safety on REXE servers. RAID 1 or RAID 10 provides high reliability for critical data, while smartctl and smartd let you detect disk failures before they happen. Regular SMART tests and RAID status checks are the most effective way to prevent unexpected data loss.
It depends on your use case: RAID 10 for high performance + reliability (4+ disks), RAID 5 for cost-effective reliability (3+ disks), RAID 1 for simple redundancy (2 disks). RAID 10 is recommended for production databases. RAID 0 provides no data safety, only performance improvement.
Get a replacement disk immediately. Mark the failed disk with 'sudo mdadm /dev/md0 --fail /dev/sdb', remove it with 'sudo mdadm /dev/md0 --remove /dev/sdb', insert the new disk, and add it with 'sudo mdadm /dev/md0 --add /dev/sdc'. The RAID will rebuild automatically.
Back up your data immediately! Examine detailed SMART data with 'sudo smartctl -a /dev/sda'. If Reallocated_Sector_Ct, Current_Pending_Sector, or Offline_Uncorrectable values are high, the disk is near failure. Replace the disk as soon as possible.
Hardware RAID uses a dedicated controller card and doesn't burden the CPU; it's faster and more reliable but expensive. Software RAID (mdadm) is managed by the Linux kernel; it's free and flexible but uses CPU. Hardware RAID is preferred on REXE physical servers.
No! RAID protects against disk failure but does not replace backups. Accidentally deleted files, ransomware attacks, or logical errors are not protected by RAID. RAID and regular backups should be used together.
Step-by-step SSH connection guide for Linux VDS: PuTTY, Terminal, key-based authentication, Path Panel firewall rules, and security best practices.
Complete guide to connecting to Windows Server VDS via Remote Desktop (RDP): setup steps, NLA security, Path Panel firewall rule, and troubleshooting tips.
Step-by-step guide to changing your VDS server OS via REXE panel: backup tips, supported Linux distributions and Windows Server versions explained.