linux:start

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:start [2026/04/26 22:11] – [Diagnostics] mhlinux:start [2026/04/26 22:17] (current) mh
Line 109: Line 109:
  
 ====== Storage & Filesystems ====== ====== Storage & Filesystems ======
 +
 +===== Mounting =====
 +
 +=== List mounts: ===
 +
 +<code bash>
 +findmnt
 +</code>
 +
 +=== List disks: ===
 +
 +<code bash>
 +lsblk
 +</code>
 +
 +=== Mount: ===
 +
 +<code bash>
 +sudo mkdir -p /media/DRIVE
 +sudo mount /dev/sdX# /media/DRIVE
 +</code>
 +
 +=== Unmount: ===
 +
 +<code bash>
 +sudo umount /media/DRIVE
 +</code>
 +
 +----
 +
 +==== Samba ====
 +
 +Manage service:
 +
 +<code bash>
 +sudo systemctl start smbd
 +sudo systemctl stop smbd
 +sudo systemctl restart smbd
 +</code>
 +
 +----
 +
 +===== Mount/Repair NTFS =====
 +
 +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#
 +</code>
 +
 +Then remount:
 +
 +<code bash>
 +sudo mount -t ntfs3 /dev/sdX# /mnt/ntfs
 +</code>
 +
 +Create mount point if needed:
 +
 +<code bash>
 +sudo mkdir -p /mnt/ntfs
 +</code>
 +
 +<WRAP info>
 +**Notes:**
 +
 +  * ''ntfsfix'' performs basic repairs and clears the "dirty" flag
 +  * Full repair should be done from Windows using ''chkdsk''
 +  * If the issue persists, ensure Windows Fast Startup is disabled
 +</WRAP>
 +
 +===== 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
 +</code>
 +
 +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
 +</code>
 +
 +Repair the filesystem:
 +
 +<code bash>
 +sudo umount /dev/sdX#
 +sudo fsck.vfat -a -w /dev/sdX#
 +</code>
 +
 +  * ''-a'' automatically repair filesystem
 +  * ''-w'' write changes to disk
 +
 +Note: Ensure the correct device is targeted before running ''fsck''.
 +
 +
 +====== File & Data Operations ======
 +
 +===== Shell toolbox =====
 +
 +==== File operations ====
 +
 +=== Mass renaming ===
 +
 +Uppercase .JPG to lowercase .jpg
 +
 +<code bash>
 +for i in *.JPG; do mv "$i" "${i/.JPG/.jpg}"; done
 +</code>
 +
 +Alternative (rename tool):
 +
 +<code bash>
 +rename 's/\.JPG$/.jpg/' *.JPG
 +</code>
 +
 +----
 +
 +=== Empty a file ===
 +
 +<code bash>
 +: > /path/to/file
 +</code>
 +
 +----
 +
 +==== Text processing ====
 +
 +=== cut ===
 +
 +Extract part of a string:
 +
 +<code bash>
 +date | cut -c17-24
 +</code>
 +
 +----
 +
 +==== Archives ====
 +
 +=== tar ===
 +
 +<code bash>
 +# Extract
 +tar -xvf file.tar
 +tar -xvzf file.tar.gz
 +
 +# Create
 +tar -cvf file.tar /path/folder
 +tar -cvzf file.tar.gz /path/folder
 +</code>
 +
 +Flags:
 +
 +  * ''c'' create archive
 +  * ''x'' extract archive
 +  * ''v'' verbose (list files processed)
 +  * ''f'' specify archive file
 +  * ''z'' gzip compression
 +
 +----
 +
 +====== User Environment ======
 +
 ===== PATH ===== ===== PATH =====
 <WRAP round info> <WRAP round info>
Line 317: Line 488:
 </WRAP> </WRAP>
  
-===== 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
 </code> </code>
  
-Typical errors:+Common options:
  
-<code bash+<code> 
-FAT-fs (sdb1): error, corrupted directory (invalid entries) +--fs            # fullscreen 
-FAT-fs (sdb1): Filesystem has been set read-only +--no-border     # remove window decorations 
-FAT-fs (sdb1): error, invalid access to FAT+--ontop         # keep window above others 
 +--geometry=+X+Y # window position (multi-display setups) 
 +--osd-level=0   # disable on-screen display
 </code> </code>
  
-Repair the filesystem:+Configuration file:
  
-<code bash+<code> 
-sudo umount /dev/sdX# +~/.config/mpv/mpv.conf 
-sudo fsck.vfat --/dev/sdX#+</code> 
 + 
 +---- 
 + 
 +==== mplayer (legacy) ==== 
 + 
 +Legacy setup kept for reference. 
 + 
 +Configuration files: 
 + 
 +  */etc/mplayer/mplayer.conf 
 +  *~/.mplayer/config 
 +  *~/.mplayer/input.conf 
 +  *~/.mplayer/menu.conf 
 + 
 +Example options: 
 + 
 +<code> 
 +fs=yes 
 +noborder=yes 
 +ontop=yes 
 +geometry=+3200 
 +osdlevel=0
 </code> </code>
  
-  * ''-a'' automatically repair filesystem 
-  * ''-w'' write changes to disk 
  
-Note: Ensure the correct device is targeted before running ''fsck''. 
  
 +====== Specialized & Recovery ======
  
 ===== Data recovery ===== ===== Data recovery =====
Line 384: 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/Repair NTFS ===== 
  
-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# 
-</code> 
- 
-Then remount: 
- 
-<code bash> 
-sudo mount -t ntfs3 /dev/sdX# /mnt/ntfs 
-</code> 
- 
-Create mount point if needed: 
- 
-<code bash> 
-sudo mkdir -p /mnt/ntfs 
-</code> 
- 
-<WRAP info> 
-**Notes:** 
- 
-  * ''ntfsfix'' performs basic repairs and clears the "dirty" flag 
-  * Full repair should be done from Windows using ''chkdsk'' 
-  * If the issue persists, ensure Windows Fast Startup is disabled 
-</WRAP> 
- 
-===== 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 
-</code> 
- 
-Common options: 
- 
-<code> 
---fs            # fullscreen 
---no-border     # remove window decorations 
---ontop         # keep window above others 
---geometry=+X+Y # window position (multi-display setups) 
---osd-level=0   # disable on-screen display 
-</code> 
- 
-Configuration file: 
- 
-<code> 
-~/.config/mpv/mpv.conf 
-</code> 
- 
----- 
- 
-==== mplayer (legacy) ==== 
- 
-Legacy setup kept for reference. 
- 
-Configuration files: 
- 
-  */etc/mplayer/mplayer.conf 
-  *~/.mplayer/config 
-  *~/.mplayer/input.conf 
-  *~/.mplayer/menu.conf 
- 
-Example options: 
- 
-<code> 
-fs=yes 
-noborder=yes 
-ontop=yes 
-geometry=+3200 
-osdlevel=0 
-</code> 
  
 ===== Using Apple USB SuperDrive ===== ===== Using Apple USB SuperDrive =====
Line 669: Line 785:
 </WRAP> </WRAP>
  
-===== Shell toolbox ===== 
  
-==== File operations ==== 
  
-=== Mass renaming === 
  
-Uppercase .JPG to lowercase .jpg 
- 
-<code bash> 
-for i in *.JPG; do mv "$i" "${i/.JPG/.jpg}"; done 
-</code> 
- 
-Alternative (rename tool): 
- 
-<code bash> 
-rename 's/\.JPG$/.jpg/' *.JPG 
-</code> 
- 
----- 
- 
-=== Empty a file === 
- 
-<code bash> 
-: > /path/to/file 
-</code> 
- 
----- 
- 
-==== Text processing ==== 
- 
-=== cut === 
- 
-Extract part of a string: 
- 
-<code bash> 
-date | cut -c17-24 
-</code> 
- 
----- 
- 
-==== Archives ==== 
- 
-=== tar === 
- 
-<code bash> 
-# Extract 
-tar -xvf file.tar 
-tar -xvzf file.tar.gz 
- 
-# Create 
-tar -cvf file.tar /path/folder 
-tar -cvzf file.tar.gz /path/folder 
-</code> 
- 
-Flags: 
- 
-  * ''c'' create archive 
-  * ''x'' extract archive 
-  * ''v'' verbose (list files processed) 
-  * ''f'' specify archive file 
-  * ''z'' gzip compression 
- 
----- 
- 
-==== Mounting ==== 
- 
-=== List mounts: === 
- 
-<code bash> 
-findmnt 
-</code> 
- 
-=== List disks: === 
- 
-<code bash> 
-lsblk 
-</code> 
- 
-=== Mount: === 
- 
-<code bash> 
-sudo mkdir -p /media/DRIVE 
-sudo mount /dev/sdX# /media/DRIVE 
-</code> 
- 
-=== Unmount: === 
- 
-<code bash> 
-sudo umount /media/DRIVE 
-</code> 
- 
----- 
- 
-==== Samba ==== 
- 
-Manage service: 
- 
-<code bash> 
-sudo systemctl start smbd 
-sudo systemctl stop smbd 
-sudo systemctl restart smbd 
-</code> 
- 
----- 
  
 ==== Package management ==== ==== Package management ====
  • linux/start.1777234301.txt.gz
  • Last modified: 2026/04/26 22:11
  • by mh