From 1fcbabd75496a099983f736b0acd33bd97cc3f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Sat, 1 Nov 2025 22:38:37 +0000 Subject: [PATCH] modified: README.md modified: docs/file-systems.md --- README.md | 62 +++++++++++++++++++++ docs/file-systems.md | 129 +++++++++++-------------------------------- 2 files changed, 95 insertions(+), 96 deletions(-) diff --git a/README.md b/README.md index fc582b5..01a29eb 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,13 @@ - [System Monitoring Utilities](#system-monitoring-utilities) - [btop](#btop) - [Storage](#storage) + - [Disk Space and Used](#disk-space-and-used) + - [Physical Disks and Partition](#physical-disks-and-partition) - [hdparm](#hdparm) + - [smartctl](#smartctl) - [Network Storage](#network-storage) - [smb](#smb) + - [gio](#gio) - [CLI Diagnostics and System Topology](#cli-diagnostics-and-system-topology) - [lspci](#lspci) @@ -205,6 +209,34 @@ apt update && apt install btop -y ### Storage +#### Disk Space and Used + +``` bash +df -h +``` + +#### Physical Disks and Partition + +**List physical disks and partition size:** + +``` bash +lsblk +``` + +**Get Partition id:** + +``` bash +blkid /dev/sdX +``` + +##### Partition Manager + +``` bash +fdisk /dev/sdX +``` + +[check](./docs/file-systems.md) for file systems. + #### hdparm hdparm is a powerful command-line utility in Linux used to view and configure low-level parameters of SATA, IDE, and some USB hard drives. It’s commonly used for performance tuning, diagnostics, and power management. @@ -214,6 +246,17 @@ sudo apt install hdparm sudo hdparm -Tt /dev/sdc ``` +#### smartctl + +smartctl is a command-line utility used to monitor and manage the health of storage devices like HDDs and SSDs using S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology). + +Here’s a deeper look at what smartctl does and why it’s useful: + +```bash +#check smart status +smartctl -a /dev/sdX +``` + ``` bash df df -h @@ -249,6 +292,25 @@ Add line //nas.lan/homes /mnt/smb-share:mf@nas.lan,share=homes cifs credentials=/home/mf/.credentials/smb:mf@nas.lan,uid=1000,gid=1000,nofail 0 0 ``` +#### gio + +**mount samba share:** + +```bash +#/home/username/.credentials +#username +#SAMBA +#password +gio mount smb://server/share < /home/username/.credentials +``` + +**unmount:** + +```bash +gio mount -u smb://server/share +``` + + ### CLI Diagnostics and System Topology #### lspci diff --git a/docs/file-systems.md b/docs/file-systems.md index c47e8f6..7169db4 100644 --- a/docs/file-systems.md +++ b/docs/file-systems.md @@ -1,5 +1,27 @@ # File Systems +- [zfs](#zfs) +- [ext4](#ext4) +- [ext3](#ext3) +- [exFat](#exfat) +- [ntfs](#ntfs) + +## zfs + +ZFS (Zettabyte File System) is a high-performance, open-source file system and volume manager known for its advanced features like data integrity, snapshots, compression, and pooled storage. It was originally developed by Sun Microsystems in 2001 and introduced in 2005 for Solaris, later evolving into OpenZFS for broader platform support. + +**🧠 Key Features of ZFS**: + +- **Pooled Storage Architecture**: Instead of managing individual volumes, ZFS uses storage pools (zpools) that aggregate multiple physical devices. This allows dynamic allocation of space to datasets without manual partitioning. +- **Copy-on-Write** (CoW): ZFS never overwrites data in place. When data is modified, it writes the new version to a new location and updates metadata, ensuring consistent snapshots and preventing corruption. +- **End-to-End Data Integrity**: ZFS checksums all data and metadata, automatically detecting and correcting silent data corruption using redundant copies. +- **Snapshots and Clones**: You can create instant, space-efficient snapshots of the file system. Clones allow writable copies of snapshots, useful for testing or backups. +- **Built-in RAID Support**: ZFS includes native support for various RAID levels (RAID-Z, RAID-Z2, RAID-Z3), eliminating the need for separate volume managers. +- **Compression and Deduplication**: ZFS supports transparent compression (e.g., LZ4, gzip) and optional deduplication to save space. +- **Scalability**: It supports massive storage capacities — up to 256 trillion yobibytes for volume size and 16 exbibytes for individual files + +[Check for more information](https://git.limbosolutions.com/kb/zfs). + ## ext4 Ext4 (Fourth Extended File System) is a modern journaling file system used by most Linux distributions. It offers high performance, reliability, and support for large volumes and files. @@ -12,6 +34,17 @@ Example mkfs.ext4 /dev/sdb1 ``` +**fstab mount example:** + +``` bash +#add line +PARTUUID= ext4 defaults,nofail 0 02 +``` + +``` bash +mount -a +``` + ## ext3 mkfs.ext3 _filesys_ @@ -40,101 +73,5 @@ apt-get install ntfs-3g mkntfs --fast --label Backups /dev/sdc1 ``` -## Manutenção de discos - -Bad Sectors -sudo e2fsck -cfpv /dev/sda1 -O Exemplo foi com o disco sda1 mas deverá ser substituído pelo disco desejado - -Os parâmetros têm os seguintes significados: - -“c” procura por blocos defeituosos e os adiciona à lista - -“f” força uma verificação no sistema de arquivos - -“p” repara qualquer coisa que possa ser reparada com segurança - -“v” está no modo detalhado. você pode ver o progresso do comando - -Esse comando pode levar muito tempo para ser executado, até várias horas em uma unidade particularmente grande. - -## Disks - -File System & Space Usage - -``` bash -df -h -``` - -List physical disks and partition size - -``` bash -lsblk -``` - -List partition ids - -``` bash -blkid /dev/sdc1 -``` - -Partition Manager - -``` bash -fdisk /dev/ -#Example: -fdisk /dev/sdc - -#Partições como mais de 2 TB -sudo parted /dev/sdc -#(parted) mklabel gpt -#alterar para a unidade de medida que desejar -#(parted) unit TB -#ver espaço livre -(parted) print free -#criar partição com espaço livre (exemplo:4 Teras) -mkpart primary ext4 0 4 -#Formatar uma partição -``` - -## mount - -Mount partition on boot fstab - -``` bash -nano /etc/fstabexemplo de alias -``` - -ext4 example - -``` bash -#add line -PARTUUID= ext4 defaults,nofail 0 02 -``` - -Mount fstab partions without reboot - -``` bash -mount -a -``` - gvfs-mount 'ftp://user@www.your-server.com/folder' [source](https://9to5answer.com/how-to-automount-a-gvfs-file-system-on-logon) - -## gio - -### mount samba share - -```bash -#/home/username/.credentials -#username -#SAMBA -#password -gio mount smb://server/share < /home/username/.credentials -``` - -### unmount - -```bash -gio mount -u smb://server/share -``` \ No newline at end of file