Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
home_server:home_server_setup:other_services:disk [2020-08-29 Sat wk35 20:18] – [mount] baumkphome_server:home_server_setup:other_services:disk [2025-09-14 Sun wk37 15:54] (current) – [Block Device Monitoring and Control] baumkp
Line 1: Line 1:
-{{tag>linux ubuntu parted fstab format partion disk mount umount fstab unmount}}+{{tag>linux debian nfs parted fstab format partion disk mount umount fstab unmount}}
 =======Linux Block Device Notes====== =======Linux Block Device Notes======
  
Line 5: Line 5:
  
 ====Some basic tools==== ====Some basic tools====
-''lsblk''  to list partitions (or list block devices) +  *''ls -l /dev/disk/by-uuid/'' will list the disks with UUIDs 
-''lsblk -f'' or ''blkid''  to list the UUIDs+  *''lsblk''  to list partitions (or list block devices) 
 +  *''lsblk -f'' or ''blkid''  to list the UUIDs 
 +  *''sudo blkid'' will list data blocks
  
 ---- ----
Line 34: Line 36:
  
 ===Local Device=== ===Local Device===
-mount -t ext2 /dev/sdb1 /mnt+**mount -t ext4 /dev/sdb1 /run/media/diska**
  
 ===NFS Device=== ===NFS Device===
  
-To mount a NFS manually: +To mount a NFS manually:  
- +  *''sudo mount -t nfs -o rw,vers=4 192.168.1.5:/export/Disk1 /mnt/backup1'' 
-    sudo mount -t nfs -o rw,vers=4 192.168.1.5:/export/Disk1 /mnt/backup1 +  *''sudo mount -t nfs -o rw,vers=4 192.168.1.5:/export/Disk2 /mnt/backup2''
-    sudo mount -t nfs -o rw,vers=4 192.168.1.5:/export/Disk2 /mnt/backup2+
  
 Where: Where:
- +  * ''-t nfs'' : type nfs 
-    -t nfs : type nfs +  * ''-o'' : options, options are separated by commas with no spaces 
-    -o : options, options are separated by commas with no spaces +    * ''rw'' : read / write 
-        rw : read / write +    * ''vers=4'' : version 4 of nfs 
-        vers=4 : version 4 of nfs +  * ''192.168.1.5:/export/Disk1'' is the remote exported NFS mount point 
-    192.168.1.5:/export/Disk1 is the remote exported NFS mount point +  * ''/mnt/backup1'' : is the local mount point, note this directory must exist, ideally empty, any existing contents are usually invisible and otherwise ignored
-    /mnt/backup1 : is the local mount point, note this directory must exist, ideally empty, any existing contents are usually invisible and otherwise ignored +
  
 ---- ----
 ====unmount==== ====unmount====
-umount /mnt+''sudo umount /run/media/diska'' 
  
 ---- ----
Line 64: Line 64:
 ---- ----
 =====Block Device Monitoring and Control===== =====Block Device Monitoring and Control=====
 +My main server has a parity disk that is normally only is used once a week.  I would like to place this hard disk in to stand-by to reduce power and wear and tear upon it.
  
 ====smartmon==== ====smartmon====
 +  * ''sudo smartctl -i -n standby /dev/sdb''  will chack the HD activity mode.  It does this without starting up the drive, which hdparm may do.
 +    * If in standby mode it reports back only: "Device is in STANDBY mode, exit(2)" otherwise
 +    * ++ active or idel mode|
 +<code>smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.12.41+deb13-amd64] (local build)
 +Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
 +
 +=== START OF INFORMATION SECTION ===
 +Model Family:     Western Digital Red Plus
 +Device Model:     WDC WD100EFAX-68LHPN0
 +Serial Number:    xxxxxx
 +LU WWN Device Id: xxxxxxxxx
 +Firmware Version: 83.H0A83
 +User Capacity:    10,000,831,348,736 bytes [10.0 TB]
 +Sector Sizes:     512 bytes logical, 4096 bytes physical
 +Rotation Rate:    5400 rpm
 +Form Factor:      3.5 inches
 +Device is:        In smartctl database 7.3/5804
 +ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4
 +SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
 +Local Time is:    Sun Sep 14 11:21:22 2025 AWST
 +SMART support is: Available - device has SMART capability.
 +SMART support is: Enabled
 +Power mode is:    ACTIVE or IDLE</code>
 +++
  
 ---- ----
  
 ====hdparm==== ====hdparm====
 +  *''sudo hdparm -y /dev/sdb'' sets the HD into standby mode
 +
 +To for the HD into standby mode after reboot and set the standby time crate and use an on boot systemd service.
 +++++/etc/systemd/system/hdparm.service|
 +<code bash>[Unit]
 +Description=hdparm sleep
 +
 +[Service]
 +Type=oneshot
 +ExecStart=/usr/sbin/hdparm -q -S 120 -y /dev/sdb
 +
 +[Install]
 +WantedBy=multi-user.target</code>
 +++++
 +Some tips:
 +  *use ''whereis hdparm'' to confirm where the command is installed.
 +  *use ''sudo apt install hdparm'' to install if required
 +  *use ''sudo systemctl daemon-reload'' after modifying or creating a new systemd service to update systemd configuration
 +  *use ''sudo systemctl status hdparm.service'' to see status of service and enable if required.
 +====idle3-tools====
 +[[https://idle3-tools.sourceforge.net/|idle3-tools]] provides a linux/unix utility that can disable, get and set the value of the infamous idle3 timer found on recent Western Digital Hard Disk Drives.
 +  *[[https://man.archlinux.org/man/idle3ctl.8|IDLE3CTL(8)]] man page from Archlinux
 +
 +====References====
 +  *[[https://www.digitalocean.com/community/tutorials/how-to-partition-and-format-storage-devices-in-linux|How To Partition and Format Storage Devices in Linux]]
  
 ---- ----