WebHosting

Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Wednesday, September 27, 2023

Troubleshooting disk issues in Linux requires various commands and checks. Here are some important Linux commands for disk troubleshooting

1. **Check Disk Space:** Use `df -h` to check the disk space usage on all mounted partitions.

2. **Check Disk Usage:** Use `du -h` to check the disk usage of specific directories.

3. **Check Disk Health:** Use `smartctl` to check the SMART status of a disk, e.g., `smartctl -a /dev/sda`.

4. **Check Disk Partitions:** Use `fdisk -l` or `parted -l` to list disk partitions and their details.

5. **Check Filesystem Integrity:** Use `fsck` to check and repair filesystem errors. Run it on unmounted partitions, e.g., `fsck /dev/sda1`.

6. **View Disk I/O:** Use `iotop` to view disk I/O in real-time.

7. **Check Disk Errors:** Check the `/var/log/syslog` or `/var/log/messages` file for disk-related error messages.

8. **Mount/Unmount Disks:** Use `mount` and `umount` to manually mount and unmount filesystems.

9. **Disk Performance Monitoring:** Use `iostat` to monitor disk performance and I/O statistics.

10. **Check Disk Temperature:** Use `hddtemp` or `smartctl -a` to check the temperature of a disk.

11. **List Mounted Filesystems:** Use `mount` to list currently mounted filesystems.

12. **Check Disk Space Usage per Directory:** Use `ncdu` (if installed) to interactively analyze disk usage per directory.

13. **Check Disk Read/Write Speed:** Use `hdparm` to test disk read and write speeds, e.g., `hdparm -tT /dev/sda`.

14. **Check Disk UUID:** Use `blkid` to list the UUIDs of disk partitions.

15. **Check Disk Permissions:** Ensure that permissions are set correctly for directories and files on the disk.

16. **Check for Bad Blocks:** Use `badblocks` to scan for and mark bad blocks on a disk, e.g., `badblocks -s /dev/sda`.

17. **Unmount Stuck Disk:** Use `fuser` and `lsof` to find processes using a mounted disk and then unmount it.

18. **Disk Partitioning:** Use `fdisk` or `parted` to create, delete, or resize disk partitions.

19. **Disk Benchmarking:** Use tools like `dd` or specialized benchmarking software to test disk performance.

20. **Backup and Restore:** Regularly backup important data and use tools like `tar` or `rsync` for data backup and restoration.

#DiskIssues, #DiskTroubleshooting, #FileSystem, #DiskHealth, #StorageManagement, #SMARTStatus, #FilesystemErrors, #DiskPerformance, #DataRecovery, #DiskMaintenance, #DiskMonitoring, #DiskPartitions, #FilesystemRepair, #DiskErrors, #IOTop, #DiskSpace, #BadBlocks, #DiskTemperature, #BackupAndRestore, #DiskBenchmarking

Friday, January 18, 2013

Shell script: Using FOR loop

Here's a simple shell script to print numbers using for loop.

Just got through:


# cat test.sh

for ((i=0;i<=10;i++))
do

 echo $i

done



Output:

Featured Posts

How to Enable and Configure Remote Desktop (RDP) on Ubuntu 24.04.4 LTS

Remote Desktop Protocol (RDP) support in Ubuntu has become considerably easier with the GNOME Remote Desktop stack included in modern Ubuntu...