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.
Linux disk management: analyze usage with df/du, partition with fdisk/parted, manage volumes with LVM, extend partitions, and configure persistent mounts.
Disk management is critical for server health and performance. This guide covers monitoring disk usage, partitioning tools, LVM (Logical Volume Manager) basics, partition expansion, and mounting.
Disk operations can be irreversible. Back up important data before proceeding.
# Show all filesystems
df -h
# Show filesystem for a specific directory
df -h /var
# Show inode usage
df -i
# Include filesystem type
df -hT
Example output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 20G 28G 42% /
/dev/sdb1 100G 45G 50G 47% /data
tmpfs 2.0G 0 2.0G 0% /dev/shm
# Show directory size
du -sh /var/log
# Show subdirectories
du -h --max-depth=1 /var
# Find the largest directories
du -h /var | sort -rh | head -20
# Find files larger than 100 MB
find / -size +100M -type f 2>/dev/null
# List all block devices
lsblk
# With detailed info
lsblk -f
# Show disk information
sudo fdisk -l
# For a specific disk
sudo fdisk -l /dev/sda
# Show disk UUIDs
blkid
fdisk is an interactive tool for MBR (Master Boot Record) disk partitioning.
# Start fdisk
sudo fdisk /dev/sdb
Commands inside fdisk:
m — Help menu
p — Print partition table
n — New partition
d — Delete partition
t — Change partition type
w — Write changes and exit
q — Quit without saving
sudo fdisk /dev/sdb
# n → new partition
# p → primary partition
# 1 → partition number
# Enter → default start sector
# +50G → 50 GB size
# w → write
# Format the partition
sudo mkfs.ext4 /dev/sdb1
# Create mount point
sudo mkdir /mnt/data
# Mount it
sudo mount /dev/sdb1 /mnt/data
parted works with both MBR and GPT disks. GPT is required for disks larger than 2 TB.
# Start parted
sudo parted /dev/sdb
# Create GPT partition table
(parted) mklabel gpt
# Create partition
(parted) mkpart primary ext4 0% 100%
# Show partition table
(parted) print
# Exit
(parted) quit
# Format
sudo mkfs.ext4 /dev/sdb1
# Create GPT table and use entire disk as one partition
sudo parted -s /dev/sdb mklabel gpt mkpart primary ext4 0% 100%
# Format
sudo mkfs.ext4 /dev/sdb1
LVM (Logical Volume Manager) abstracts physical disks for flexible storage management. You can resize volumes online and combine multiple disks.
| Concept | Abbreviation | Description |
|---|---|---|
| Physical Volume | PV | Physical disk or partition |
| Volume Group | VG | Pool created from PVs |
| Logical Volume | LV | Logical partition allocated from VG |
# Install LVM tools
sudo apt install lvm2 -y
# Create physical volume
sudo pvcreate /dev/sdb
# Create volume group
sudo vgcreate vg_data /dev/sdb
# Create logical volume (50 GB)
sudo lvcreate -L 50G -n lv_data vg_data
# Format
sudo mkfs.ext4 /dev/vg_data/lv_data
# Mount
sudo mkdir /mnt/data
sudo mount /dev/vg_data/lv_data /mnt/data
# Physical volume info
sudo pvs
sudo pvdisplay
# Volume group info
sudo vgs
sudo vgdisplay
# Logical volume info
sudo lvs
sudo lvdisplay
# Add new disk and create PV
sudo pvcreate /dev/sdc
# Add to VG
sudo vgextend vg_data /dev/sdc
# Extend LV (use all free space)
sudo lvextend -l +100%FREE /dev/vg_data/lv_data
# Resize filesystem (ext4)
sudo resize2fs /dev/vg_data/lv_data
# For xfs
sudo xfs_growfs /mnt/data
Edit /etc/fstab to automatically mount disks on reboot:
# Get UUID
blkid /dev/sdb1
# Edit /etc/fstab
sudo nano /etc/fstab
# /etc/fstab format:
# UUID=xxxx /mount/point filesystem options dump pass
UUID=a1b2c3d4-... /mnt/data ext4 defaults 0 2
# Test fstab (shows errors)
sudo mount -a
# Show all mounts
mount | grep /mnt
A mistake in /etc/fstab can prevent the system from booting. Back up first: sudo cp /etc/fstab /etc/fstab.bak
# Check SMART status
sudo apt install smartmontools -y
sudo smartctl -a /dev/sda
# Run a short test
sudo smartctl -t short /dev/sda
# Check filesystem for errors (unmounted disk)
sudo fsck -n /dev/sdb1
Disk management is a core component of server maintenance. Regular usage monitoring with df/du, flexible volume management with LVM, and proactive disk health monitoring with SMART tools will keep your server's storage infrastructure healthy.
First use 'df -h' to identify which partition is full, then 'du -sh /* 2>/dev/null | sort -rh | head -20' to find the largest directories. Common culprits are log files (/var/log), temporary files (/tmp), and old package caches (apt clean). If you use LVM, you can then extend the partition.
LVM is recommended for new installations: you can resize partitions online, combine multiple disks, and take snapshots. Standard partitioning is simpler with lower overhead; it's sufficient for small, fixed-size systems.
The disk may not be added to /etc/fstab. Get the disk UUID with 'blkid' and add it to /etc/fstab in the correct format. Test the change with 'sudo mount -a'. Avoid using /dev/sdX instead of UUID; disk order can change.
Disks larger than 2 TB require GPT (GUID Partition Table). Use parted or gdisk instead of fdisk: 'sudo parted /dev/sdb mklabel gpt'. MBR (fdisk default) supports a maximum of 2 TB.
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.