en:linux:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:linux:start [2022/11/20 11:25] – [force fsck] frank | en:linux:start [2024/04/07 19:40] (current) – [LVM] frank | ||
---|---|---|---|
Line 85: | Line 85: | ||
ps -o pid,args -C tcpdump | ps -o pid,args -C tcpdump | ||
+ | ===== ls ===== | ||
+ | |||
+ | full timestamps: | ||
+ | |||
+ | ls -l --time-style=" | ||
+ | |||
+ | deactivate colors: | ||
+ | |||
+ | ls -l --color=none | ||
+ | |||
+ | ===== bashrc / alias ===== | ||
+ | |||
+ | alias cp=" | ||
+ | alias pynano=" | ||
+ | alias catconf=' | ||
===== nano ===== | ===== nano ===== | ||
Line 120: | Line 135: | ||
sudo badblocks -nsv /dev/sdb | sudo badblocks -nsv /dev/sdb | ||
+ | http:// | ||
====== NTP ====== | ====== NTP ====== | ||
Line 125: | Line 141: | ||
#nano / | #nano / | ||
service ntp status | service ntp status | ||
+ | #show state of servers | ||
+ | ntpq -p | ||
manual update: | manual update: | ||
Line 144: | Line 162: | ||
sudo update-alternatives --config arm-linux-gnueabihf-gcc | sudo update-alternatives --config arm-linux-gnueabihf-gcc | ||
arm-linux-gnueabihf-gcc --version | arm-linux-gnueabihf-gcc --version | ||
+ | |||
+ | #to create update-alternatives in a loop you can use this | ||
+ | for i in $(ls / | ||
other example | other example | ||
Line 154: | Line 175: | ||
mv / | mv / | ||
+ | ====== gunzip ====== | ||
+ | on-the-fly decompress and write to disk | ||
+ | |||
+ | gunzip -c bpi-r3_sdmmc_bullseye.img.gz | sudo dd bs=1M status=progress conv=notrunc, | ||
+ | |||
+ | ====== tar ====== | ||
+ | |||
+ | tar -xzf file.tar.gz --strip-components 1 -C DESTINATION | ||
+ | |||
+ | ====== sed ====== | ||
+ | |||
+ | extract text between patterns: | ||
+ | |||
+ | https:// | ||
+ | |||
+ | example (extract frequencies from iw command): | ||
+ | |||
+ | iw list | sed -n '/ | ||
====== irssi ====== | ====== irssi ====== | ||
Line 223: | Line 262: | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
</ | </ | ||
+ | |||
+ | this udev rules i use for ftdi 4xuart adapter (FT4232H Quad RS232-HS) | ||
+ | < | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | </ | ||
+ | |||
+ | easier way to get the main-properties of a device | ||
+ | |||
+ | udevadm info /dev/sdb1 | ||
====== sshd ====== | ====== sshd ====== | ||
===== qnap (entware) ===== | ===== qnap (entware) ===== | ||
Line 264: | Line 315: | ||
smartctl -t short /dev/sdb | smartctl -t short /dev/sdb | ||
smartctl -a /dev/sdb | grep -A1 " | smartctl -a /dev/sdb | grep -A1 " | ||
+ | # | ||
+ | Self-test execution status: | ||
+ | 90% of test remaining. | ||
+ | #oder: | ||
+ | Self-test execution status: | ||
+ | the read element of the test failed. | ||
+ | |||
#warten bis fertig und bei Fehler: | #warten bis fertig und bei Fehler: | ||
smartctl -a /dev/sdb | grep ' | smartctl -a /dev/sdb | grep ' | ||
+ | Beispielausgabe mit Fehler (long): | ||
+ | # 1 Extended offline | ||
+ | |||
#sektor und angrenzende in Schleife versuchen neu zu schreiben | #sektor und angrenzende in Schleife versuchen neu zu schreiben | ||
- | for i in {1709860..1709870};do hdparm --yes-i-know-what-i-am-doing --repair-sector $i / | + | for i in {1709920..1709930};do hdparm --yes-i-know-what-i-am-doing --repair-sector $i / |
+ | </ | ||
+ | |||
+ | ===== iostat ===== | ||
+ | |||
+ | apt install sysstat | ||
+ | |||
+ | Ausgabe: | ||
+ | |||
+ | < | ||
+ | Linux 5.15.0-56-generic (frank-G5) 29.12.2022 _x86_64_ (12 CPU) | ||
+ | |||
+ | avg-cpu: | ||
+ | | ||
+ | |||
+ | Device | ||
+ | sdb | ||
+ | sdb1 0,01 | ||
</ | </ | ||
===== rc.local ===== | ===== rc.local ===== | ||
Line 328: | Line 406: | ||
Solution using / | Solution using / | ||
+ | |||
+ | ===== LVM ===== | ||
+ | https:// | ||
+ | |||
+ | prepared initrd | ||
+ | < | ||
+ | apt install initramfs-tools | ||
+ | kernelversion=$(uname -r) | ||
+ | echo $kernelversion | ||
+ | zcat / | ||
+ | less / | ||
+ | update-initramfs -k $kernelversion -c | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | root@bpi-r3-mini: | ||
+ | root@bpi-r3-mini: | ||
+ | #changed type of partition 3 to lvm | ||
+ | root@bpi-r3-mini: | ||
+ | root@bpi-r3-mini: | ||
+ | Volume group " | ||
+ | root@bpi-r3-mini: | ||
+ | --- Volume group --- | ||
+ | VG Name | ||
+ | System ID | ||
+ | Format | ||
+ | Metadata Areas 1 | ||
+ | Metadata Sequence No 1 | ||
+ | VG Access | ||
+ | VG Status | ||
+ | MAX LV 0 | ||
+ | Cur LV 0 | ||
+ | Open LV 0 | ||
+ | Max PV 0 | ||
+ | Cur PV 1 | ||
+ | Act PV 1 | ||
+ | VG Size 80.74 GiB | ||
+ | PE Size 4.00 MiB | ||
+ | Total PE 20670 | ||
+ | Alloc PE / Size 0 / 0 | ||
+ | Free PE / Size 20670 / 80.74 GiB | ||
+ | VG UUID | ||
+ | | ||
+ | root@bpi-r3-mini: | ||
+ | Logical volume " | ||
+ | root@bpi-r3-mini: | ||
+ | root@bpi-r3-mini: | ||
+ | [ 5279.856899] EXT4-fs (dm-0): mounted filesystem 520d434d-fdfc-48f3-823d-77e602 | ||
+ | 7e84e7 r/w with ordered data mode. Quota mode: disabled. | ||
+ | root@bpi-r3-mini: | ||
+ | </ | ||
+ |
en/linux/start.txt · Last modified: 2024/04/07 19:40 by frank