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 15:44] – [Diagnostics] mhlinux:start [2026/04/26 22:17] (current) mh
Line 5: Line 5:
   -**[[linux:eGPU|Razer Core eGPU]]**   -**[[linux:eGPU|Razer Core eGPU]]**
   -**[[linux:RBS|Razer Blade Stealth in Linux]]**   -**[[linux:RBS|Razer Blade Stealth in Linux]]**
 +
 +====== System & Diagnostics ======
 +
 +===== Logs =====
 +
 +Common system logs:
 +
 +<code>
 +/var/log/syslog
 +</code>
 +
 +View recent entries:
 +
 +<code bash>
 +tail -f /var/log/syslog
 +</code>
 +
 +List recently modified log files:
 +
 +<code bash>
 +ls -lt /var/log
 +</code>
 +
 +<WRAP info>
 +**Notes:**
 +
 +  * ''tail -f'' follows logs in real time
 +  * On systemd systems, ''journalctl'' is often preferred
 +</WRAP>
 +
 +===== System information =====
 +
 +=== General overview: ===
 +
 +<code bash>
 +inxi -F
 +</code>
 +
 +=== Distribution: ===
 +
 +<code bash>
 +lsb_release -d
 +</code>
 +
 +=== Kernel: ===
 +
 +<code bash>
 +uname -snrm
 +</code>
 +
 +Flags:
 +
 +  *''s'': kernel name
 +  *''n'': network node hostname
 +  *''r'': kernel relase number
 +  *''m'': machine hardware name
 +
 +
 +=== CPU: ===
 +
 +<code bash>
 +lscpu
 +cat /proc/cpuinfo
 +</code>
 +
 +=== Memory: ===
 +
 +<code bash>
 +free -h
 +</code>
 +
 +=== Mounted filesystems: ===
 +
 +<code bash>
 +df -h
 +</code>
 +
 +=== Kernel modules: ===
 +
 +<code bash>
 +lsmod
 +</code>
 +
 +=== Bash history: ===
 +
 +<code bash>
 +history
 +</code>
 +
 +----
 +
 +===== Diagnostics =====
 +
 +<code bash>
 +uptime              # load average
 +dmesg -T | tail     # recent kernel messages
 +vmstat 1            # system performance
 +mpstat -P ALL 1     # CPU usage per core
 +pidstat             # process statistics
 +free -h             # memory usage
 +</code>
 +
 +
 +====== 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 =====
Line 214: 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 -a -w /dev/sdX#+
 </code> </code>
  
-  * ''-a'' automatically repair filesystem +----
-  * ''-w'' write changes to disk+
  
-Note: Ensure the correct device is targeted before running ''fsck''.+==== 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>
 +
 +
 +
 +====== Specialized & Recovery ======
  
 ===== Data recovery ===== ===== Data recovery =====
Line 281: 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 566: 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 ====
Line 682: Line 800:
 ---- ----
  
-==== System information ==== 
- 
-=== General overview: === 
- 
-<code bash> 
-inxi -F 
-</code> 
- 
-=== Distribution: === 
- 
-<code bash> 
-lsb_release -d 
-</code> 
- 
-=== Kernel: === 
- 
-<code bash> 
-uname -snrm 
-</code> 
- 
-Flags: 
- 
-  *''s'': kernel name 
-  *''n'': network node hostname 
-  *''r'': kernel relase number 
-  *''m'': machine hardware name 
- 
- 
-=== CPU: === 
- 
-<code bash> 
-lscpu 
-cat /proc/cpuinfo 
-</code> 
- 
-=== Memory: === 
- 
-<code bash> 
-free -h 
-</code> 
- 
-=== Mounted filesystems: === 
- 
-<code bash> 
-df -h 
-</code> 
- 
-=== Kernel modules: === 
- 
-<code bash> 
-lsmod 
-</code> 
- 
-=== Bash history: === 
- 
-<code bash> 
-history 
-</code> 
- 
----- 
- 
-==== Diagnostics ==== 
- 
-<code bash> 
-uptime              # load average 
-dmesg -T | tail     # recent kernel messages 
-vmstat 1            # system performance 
-mpstat -P ALL 1     # CPU usage per core 
-pidstat             # process statistics 
-free -h             # memory usage 
-</code> 
- 
-===== Logs ===== 
- 
-Common system logs: 
- 
-<code> 
-/var/log/syslog 
-</code> 
- 
-View recent entries: 
- 
-<code bash> 
-tail -f /var/log/syslog 
-</code> 
- 
-List recently modified log files: 
- 
-<code bash> 
-ls -lt /var/log 
-</code> 
- 
-<WRAP info> 
-**Notes:** 
- 
-  * ''tail -f'' follows logs in real time 
-  * On systemd systems, ''journalctl'' is often preferred 
-</WRAP> 
-====== Legacy ====== 
- 
-  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-===== Debug & Logs ===== 
- 
-''/var/log/syslog'' 
- 
-Check in ''/var/log'' which file was last changed. Use : 
- 
-<code bash> 
-$ls -lart //inverted sorted by time. Last entry is latest modified 
-</code> 
  
  
-===== Misc Ressources =====+===== Additional Ressources =====
  
-  *[[https://en.wikipedia.org/wiki/Magic_SysRq_key#Configuration|SysRq Keys]] -- Best combo is ''Alt + SysRq + R E I S U B''+  ***[[https://en.wikipedia.org/wiki/Magic_SysRq_key#Configuration|SysRq Keys]]** -- Best combo is ''Alt + SysRq + R E I S U B''
  
-  *[[https://www.guruadvisor.net/en/software-saas/465-advanced-linux-troubleshooting-methods-and-tools-for-diagnostics-and-problem-identification|Advanced Linux Troubleshooting]]+  ***[[https://www.guruadvisor.net/en/software-saas/465-advanced-linux-troubleshooting-methods-and-tools-for-diagnostics-and-problem-identification|Advanced Linux Troubleshooting]]**
  
-  *[[https://wiki.networksecuritytoolkit.org/nstwiki/index.php?title=HowTo_Create_A_GPT_Disk_With_EFI_System_And_exFAT_Partitions_Using_Parted|Creating GPT/exFAT partitions using CLI]]+  ***[[https://wiki.networksecuritytoolkit.org/nstwiki/index.php?title=HowTo_Create_A_GPT_Disk_With_EFI_System_And_exFAT_Partitions_Using_Parted|Creating GPT/exFAT partitions using CLI]]**
  • linux/start.1777211097.txt.gz
  • Last modified: 2026/04/26 15:44
  • by mh