Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| linux:start [2026/04/26 22:11] – mh | linux:start [2026/04/26 22:17] (current) – mh | ||
|---|---|---|---|
| Line 106: | Line 106: | ||
| free -h # memory usage | free -h # memory usage | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ====== Storage & Filesystems ====== | ||
| + | |||
| + | ===== Mounting ===== | ||
| + | |||
| + | === List mounts: === | ||
| + | |||
| + | <code bash> | ||
| + | findmnt | ||
| + | </ | ||
| + | |||
| + | === List disks: === | ||
| + | |||
| + | <code bash> | ||
| + | lsblk | ||
| + | </ | ||
| + | |||
| + | === Mount: === | ||
| + | |||
| + | <code bash> | ||
| + | sudo mkdir -p / | ||
| + | sudo mount /dev/sdX# / | ||
| + | </ | ||
| + | |||
| + | === Unmount: === | ||
| + | |||
| + | <code bash> | ||
| + | sudo umount / | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Samba ==== | ||
| + | |||
| + | Manage service: | ||
| + | |||
| + | <code bash> | ||
| + | sudo systemctl start smbd | ||
| + | sudo systemctl stop smbd | ||
| + | sudo systemctl restart smbd | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Mount/ | ||
| + | |||
| + | If an NTFS volume mounts as read-only, it is usually due to an unclean shutdown or filesystem inconsistency. | ||
| + | |||
| + | Attempt repair: | ||
| + | |||
| + | <code bash> | ||
| + | sudo ntfsfix /dev/sdX# | ||
| + | </ | ||
| + | |||
| + | Then remount: | ||
| + | |||
| + | <code bash> | ||
| + | sudo mount -t ntfs3 /dev/sdX# /mnt/ntfs | ||
| + | </ | ||
| + | |||
| + | Create mount point if needed: | ||
| + | |||
| + | <code bash> | ||
| + | sudo mkdir -p /mnt/ntfs | ||
| + | </ | ||
| + | |||
| + | <WRAP info> | ||
| + | **Notes:** | ||
| + | |||
| + | * '' | ||
| + | * Full repair should be done from Windows using '' | ||
| + | * If the issue persists, ensure Windows Fast Startup is disabled | ||
| + | </ | ||
| + | |||
| + | ===== Repair FAT32 filesystem errors ===== | ||
| + | |||
| + | If a FAT32 filesystem mounts as read-only, it is often due to detected corruption. | ||
| + | |||
| + | Check kernel logs: | ||
| + | |||
| + | <code bash> | ||
| + | dmesg | ||
| + | </ | ||
| + | |||
| + | Typical errors: | ||
| + | |||
| + | <code bash> | ||
| + | FAT-fs (sdb1): error, corrupted directory (invalid entries) | ||
| + | FAT-fs (sdb1): Filesystem has been set read-only | ||
| + | FAT-fs (sdb1): error, invalid access to FAT | ||
| + | </ | ||
| + | |||
| + | Repair the filesystem: | ||
| + | |||
| + | <code bash> | ||
| + | sudo umount /dev/sdX# | ||
| + | sudo fsck.vfat -a -w /dev/sdX# | ||
| + | </ | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | Note: Ensure the correct device is targeted before running '' | ||
| + | |||
| + | |||
| + | ====== File & Data Operations ====== | ||
| + | |||
| + | ===== Shell toolbox ===== | ||
| + | |||
| + | ==== File operations ==== | ||
| + | |||
| + | === Mass renaming === | ||
| + | |||
| + | Uppercase .JPG to lowercase .jpg | ||
| + | |||
| + | <code bash> | ||
| + | for i in *.JPG; do mv " | ||
| + | </ | ||
| + | |||
| + | Alternative (rename tool): | ||
| + | |||
| + | <code bash> | ||
| + | rename ' | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | === Empty a file === | ||
| + | |||
| + | <code bash> | ||
| + | : > / | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Text processing ==== | ||
| + | |||
| + | === cut === | ||
| + | |||
| + | Extract part of a string: | ||
| + | |||
| + | <code bash> | ||
| + | date | cut -c17-24 | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Archives ==== | ||
| + | |||
| + | === tar === | ||
| + | |||
| + | <code bash> | ||
| + | # Extract | ||
| + | tar -xvf file.tar | ||
| + | tar -xvzf file.tar.gz | ||
| + | |||
| + | # Create | ||
| + | tar -cvf file.tar / | ||
| + | tar -cvzf file.tar.gz / | ||
| + | </ | ||
| + | |||
| + | Flags: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== User Environment ====== | ||
| ===== PATH ===== | ===== PATH ===== | ||
| Line 315: | Line 488: | ||
| </ | </ | ||
| - | ===== Repair FAT32 filesystem errors | + | ===== Video playback (minimal UI) ===== |
| - | If a FAT32 filesystem mounts as read-only, it is often due to detected corruption. | + | ==== mpv (recommended) ==== |
| - | Check kernel logs: | + | Lightweight video player with minimal UI, suitable for clean output on external displays. |
| + | |||
| + | Example: | ||
| <code bash> | <code bash> | ||
| - | dmesg | + | mpv --fs --no-border --ontop --geometry=+3200 --osd-level=0 video.mp4 |
| </ | </ | ||
| - | Typical errors: | + | Common options: |
| - | < | + | < |
| - | FAT-fs (sdb1): error, corrupted directory (invalid entries) | + | --fs # fullscreen |
| - | FAT-fs (sdb1): Filesystem has been set read-only | + | --no-border |
| - | FAT-fs (sdb1): error, invalid access to FAT | + | --ontop |
| + | --geometry=+X+Y # window position | ||
| + | --osd-level=0 | ||
| </ | </ | ||
| - | Repair the filesystem: | + | Configuration file: |
| - | < | + | < |
| - | sudo umount | + | ~/.config/mpv/mpv.conf |
| - | sudo fsck.vfat -a -w /dev/sdX# | + | </ |
| + | |||
| + | ---- | ||
| + | |||
| + | ==== mplayer (legacy) ==== | ||
| + | |||
| + | Legacy setup kept for reference. | ||
| + | |||
| + | Configuration files: | ||
| + | |||
| + | */etc/mplayer/ | ||
| + | *~/ | ||
| + | *~/ | ||
| + | *~/ | ||
| + | |||
| + | Example options: | ||
| + | |||
| + | < | ||
| + | fs=yes | ||
| + | noborder=yes | ||
| + | ontop=yes | ||
| + | geometry=+3200 | ||
| + | osdlevel=0 | ||
| </ | </ | ||
| - | * '' | ||
| - | * '' | ||
| - | Note: Ensure the correct device is targeted before running '' | ||
| + | ====== Specialized & Recovery ====== | ||
| ===== Data recovery ===== | ===== Data recovery ===== | ||
| Line 382: | Line 579: | ||
| Note: This is a recovery attempt, not a guaranteed repair method. For valuable data, stop using the disk immediately and clone/image it before experimenting. | Note: This is a recovery attempt, not a guaranteed repair method. For valuable data, stop using the disk immediately and clone/image it before experimenting. | ||
| - | ===== Mount/ | ||
| - | If an NTFS volume mounts as read-only, it is usually due to an unclean shutdown or filesystem inconsistency. | ||
| - | |||
| - | Attempt repair: | ||
| - | |||
| - | <code bash> | ||
| - | sudo ntfsfix /dev/sdX# | ||
| - | </ | ||
| - | |||
| - | Then remount: | ||
| - | |||
| - | <code bash> | ||
| - | sudo mount -t ntfs3 /dev/sdX# /mnt/ntfs | ||
| - | </ | ||
| - | |||
| - | Create mount point if needed: | ||
| - | |||
| - | <code bash> | ||
| - | sudo mkdir -p /mnt/ntfs | ||
| - | </ | ||
| - | |||
| - | <WRAP info> | ||
| - | **Notes:** | ||
| - | |||
| - | * '' | ||
| - | * Full repair should be done from Windows using '' | ||
| - | * If the issue persists, ensure Windows Fast Startup is disabled | ||
| - | </ | ||
| - | |||
| - | ===== Video playback (minimal UI) ===== | ||
| - | |||
| - | ==== mpv (recommended) ==== | ||
| - | |||
| - | Lightweight video player with minimal UI, suitable for clean output on external displays. | ||
| - | |||
| - | Example: | ||
| - | |||
| - | <code bash> | ||
| - | mpv --fs --no-border --ontop --geometry=+3200 --osd-level=0 video.mp4 | ||
| - | </ | ||
| - | |||
| - | Common options: | ||
| - | |||
| - | < | ||
| - | --fs # fullscreen | ||
| - | --no-border | ||
| - | --ontop | ||
| - | --geometry=+X+Y # window position (multi-display setups) | ||
| - | --osd-level=0 | ||
| - | </ | ||
| - | |||
| - | Configuration file: | ||
| - | |||
| - | < | ||
| - | ~/ | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== mplayer (legacy) ==== | ||
| - | |||
| - | Legacy setup kept for reference. | ||
| - | |||
| - | Configuration files: | ||
| - | |||
| - | */ | ||
| - | *~/ | ||
| - | *~/ | ||
| - | *~/ | ||
| - | |||
| - | Example options: | ||
| - | |||
| - | < | ||
| - | fs=yes | ||
| - | noborder=yes | ||
| - | ontop=yes | ||
| - | geometry=+3200 | ||
| - | osdlevel=0 | ||
| - | </ | ||
| ===== Using Apple USB SuperDrive ===== | ===== Using Apple USB SuperDrive ===== | ||
| Line 667: | Line 785: | ||
| </ | </ | ||
| - | ===== Shell toolbox ===== | ||
| - | ==== File operations ==== | ||
| - | === Mass renaming === | ||
| - | Uppercase .JPG to lowercase .jpg | ||
| - | |||
| - | <code bash> | ||
| - | for i in *.JPG; do mv " | ||
| - | </ | ||
| - | |||
| - | Alternative (rename tool): | ||
| - | |||
| - | <code bash> | ||
| - | rename ' | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | === Empty a file === | ||
| - | |||
| - | <code bash> | ||
| - | : > / | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== Text processing ==== | ||
| - | |||
| - | === cut === | ||
| - | |||
| - | Extract part of a string: | ||
| - | |||
| - | <code bash> | ||
| - | date | cut -c17-24 | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== Archives ==== | ||
| - | |||
| - | === tar === | ||
| - | |||
| - | <code bash> | ||
| - | # Extract | ||
| - | tar -xvf file.tar | ||
| - | tar -xvzf file.tar.gz | ||
| - | |||
| - | # Create | ||
| - | tar -cvf file.tar / | ||
| - | tar -cvzf file.tar.gz / | ||
| - | </ | ||
| - | |||
| - | Flags: | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== Mounting ==== | ||
| - | |||
| - | === List mounts: === | ||
| - | |||
| - | <code bash> | ||
| - | findmnt | ||
| - | </ | ||
| - | |||
| - | === List disks: === | ||
| - | |||
| - | <code bash> | ||
| - | lsblk | ||
| - | </ | ||
| - | |||
| - | === Mount: === | ||
| - | |||
| - | <code bash> | ||
| - | sudo mkdir -p / | ||
| - | sudo mount /dev/sdX# / | ||
| - | </ | ||
| - | |||
| - | === Unmount: === | ||
| - | |||
| - | <code bash> | ||
| - | sudo umount / | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== Samba ==== | ||
| - | |||
| - | Manage service: | ||
| - | |||
| - | <code bash> | ||
| - | sudo systemctl start smbd | ||
| - | sudo systemctl stop smbd | ||
| - | sudo systemctl restart smbd | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| ==== Package management ==== | ==== Package management ==== | ||