User Tools

Site Tools



en:linux:start

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:linux:start [2022/12/29 14:15] – [smartctl / hdparm] franken: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="+%Y-%m-%d %H:%M"
 +
 +deactivate colors:
 +
 +  ls -l --color=none
 +
 +===== bashrc / alias =====
 +
 +  alias cp="rsync -av --partial --progress"
 +  alias pynano="nano -ET4"
 +  alias catconf='find . -type f -exec grep -Iq . {} \; -printf "\n\n%p:\n" -exec cat {} \;'
 ===== nano ===== ===== nano =====
  
Line 120: Line 135:
   sudo badblocks -nsv /dev/sdb   sudo badblocks -nsv /dev/sdb
  
 +http://www.das-werkstatt.com/forum/werkstatt/viewtopic.php?t=2346
 ====== NTP ====== ====== NTP ======
  
Line 125: Line 141:
   #nano /etc/ntp.conf # need restart after change   #nano /etc/ntp.conf # need restart after change
   service ntp status   service ntp status
 +  #show state of servers
 +  ntpq -p
  
 manual update: manual update:
Line 162: Line 180:
  
   gunzip -c bpi-r3_sdmmc_bullseye.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX   gunzip -c bpi-r3_sdmmc_bullseye.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX
 +
 +====== tar ======
 +
 +  tar -xzf file.tar.gz --strip-components 1 -C DESTINATION
 +
 +====== sed ======
 +
 +extract text between patterns:
 +
 +https://stackoverflow.com/questions/38972736/how-to-print-lines-between-two-patterns-inclusive-or-exclusive-in-sed-awk-or
 +
 +example (extract frequencies from iw command):
 +
 +  iw list | sed -n '/Frequencies/,/Band\|Supported commands/{/Band\|Supported commands/!p;}'
 ====== irssi ====== ====== irssi ======
  
Line 230: Line 262:
 SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="0001", SYMLINK+="tty_r2" SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="0001", SYMLINK+="tty_r2"
 </code> </code>
 +
 +this udev rules i use for ftdi 4xuart adapter (FT4232H Quad RS232-HS)
 +<code>
 +SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="ftdi_r2"
 +SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ENV{ID_USB_INTERFACE_NUM}=="01", SYMLINK+="ftdi_r64"
 +SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="ftdi_r3"
 +SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ENV{ID_USB_INTERFACE_NUM}=="03", SYMLINK+="ftdi_r4"
 +</code>
 +
 +easier way to get the main-properties of a device
 +
 +  udevadm info /dev/sdb1
 ====== sshd ====== ====== sshd ======
 ===== qnap (entware) ===== ===== qnap (entware) =====
Line 362: Line 406:
  
 Solution using /etc/default/locale was not working for me Solution using /etc/default/locale was not working for me
 +
 +===== LVM =====
 +https://wiki.debian.org/LVM#Create_a_PV
 +
 +prepared initrd
 +<code>
 +  apt install initramfs-tools
 +  kernelversion=$(uname -r)
 +  echo $kernelversion
 +  zcat /proc/config.gz > /boot/config-$kernelversion
 +  less /boot/config-$kernelversion
 +  update-initramfs -k $kernelversion -c
 +</code>
 +
 +<code>
 +root@bpi-r3-mini:~# apt install lvm2
 +root@bpi-r3-mini:~# fdisk /dev/nvme0n1
 +#changed type of partition 3 to lvm
 +root@bpi-r3-mini:~# pvcreate /dev/nvme0n1p3
 +root@bpi-r3-mini:~# vgcreate vg-nvme /dev/nvme0n1p3                             
 +  Volume group "vg-nvme" successfully created
 +root@bpi-r3-mini:~# vgdisplay
 +  --- Volume group ---
 +  VG Name               vg-nvme
 +  System ID             
 +  Format                lvm2
 +  Metadata Areas        1
 +  Metadata Sequence No  1
 +  VG Access             read/write
 +  VG Status             resizable
 +  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               w22Wdx-Fhch-YNsA-roWh-Zq81-qv0R-d5fnvw                  
 +                                                                                
 +root@bpi-r3-mini:~# lvcreate -n var -L 10g vg-nvme                              
 +  Logical volume "var" created.
 +root@bpi-r3-mini:~# mkfs -t ext4 /dev/vg-nvme/var
 +root@bpi-r3-mini:~# mount /dev/mapper/vg--nvme-var /var_lvm
 +[ 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:~#
 +</code>
 +
en/linux/start.1672319759.txt.gz · Last modified: 2023/06/08 17:06 (external edit)