Tuesday, April 6, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Linux mint 20 Crash caused my multiple GPU?

Posted: 06 Apr 2021 10:39 AM PDT

I need help diagnosing a system crash. I have had 2 crashes since I installed my new GPU on 3/18/2021. I installed a GT710 along side my GTX 1070. Neither of the crash reports indicated anything about it being the GPU.

Any help diagnosing the problem is greatly appreciated. I have been training machine learning models non-stop for a couple of weeks now and it is very frustrating to lose days worth of computations.

My system info is as follows: strong text

This is the Output of journalctl:

enter image description here

When my system crashed the screen was stuck at 11:53 am, but the last log is the DNS failure from 11:50am

Here is the output of my car/log/sys.log.1 when I grep for "error":

enter image description here

I am going to try and update my NVIDIA drivers and see if that helps. If I have another crash I will update here.

Thank you for any help

Trying to mount a samba share over a dedicated peer-to-peer ethernet connection

Posted: 06 Apr 2021 10:21 AM PDT

So, I have a NAS running windows server (a bunch of drivepool drives form the share), and a content management server which handles plex and a few other services. The content server runs arch. I have an SMB share which I want to be able to access from the entire network, but I also have an ethernet cable forming a peer-to-peer link on the second network port of each server. I want to use those second interfaces to form a peer-to-peer link so I can mount a share (either the same SMB share, or an NFS share) over a dedicated link, without cluttering my switch or other links. I've manually allocated both ends of the link with 172.31.254.1/30 and .2/30 IPs (yes, I know that's a waste of address space, but I don't really care for this use case), but I can't get the share to mount from the x.1 IP, just the router-facing IP. I've tried to set up a manual route on linux, but it doesn't seem to fix the problem, so I'm thinking there's something I'm missing (likely my knowledge of Windows is insufficient) Any ideas how I could accomplish this?

init unable to find root device on computer in restoration

Posted: 06 Apr 2021 10:01 AM PDT

I'm a bit out of solution on this one : I am restoring an old computer (15 years old...), which was running archlinux. I have inadvertently erased the pacman package database (and all /var ...), and I am trying to make it boot again without reinstalling (there are some /etc other stuff I would like to keep...).

I has no support for EFI, grub is installed on the disk mbr, with its configuration on a dedicated /boot partition.

I have used a Manjaro live cd to chroot into it and upgrade the base, linux, and all the fundamental packages (I would like the system to boot so that I continue reinstalling the other packages from the running system).

However, I can't get a working initramfs. I have tried multiple times to do the whole mkinitcpio -P, grub-install and grub-mkconfig, but when restarting, I always get the "Unable to find root device '...'`

I've tried to edit the command line from grub, but neither the UUID=..., the LABEL=... nor the /dev/... versions works... (by the way, to grub config seems correct since the UUID matches the one printed by lsblk

What could I have missed ? Is there some files (not tracked by pacman) from outpackage that could interfer ? Which package should I force reinstall to get a working initramfs ?

(EDIT)

initrd doesn't give much (only the traditional device .. not found. Skipping fsck and Unable to find root device .... There is also a sh: can't access tty: job control turned off. I don't have keyboard access.

The grub installation is simple grub-install --target=i386-pc /dev/sdb

The grub command line is :

load_video  set gfxpayload=keep  insmod gzio  insmod part_msdos  insmod ext2  set root='hd1,msdos1'  search --no-floppy --fs-uuid --set=root ...  linux /vmlinuz-linux root=UUID=... rw loglevel=3 quiet  initrd /initramfs-linux.img  

EDIT2

I was able to plug PS/2 keyboard, and I can use the emergency shell now... In /dev, there is no hard drive listed. I guess this is why it can't find the root fs...

Locate scheduled task on Ubuntu VPS

Posted: 06 Apr 2021 08:45 AM PDT

I had a python scraper running on my VULTR Ubuntu VPS. It is supposed to run non-stop. It stopped for some reason, so I rebooted the machine, However it still doesn't run. I cannot find the python file, all I see is a .so cpython file. Is there a way to check or find that file. Unfortunately there is no cron job for it.

"sudo apt update" fails to download packages

Posted: 06 Apr 2021 09:58 AM PDT

When trying to do sudo apt update on my server I get the following error:

<... Removed for clarity ...>    Ign https://deb.nodesource.com jessie/main Translation-en                                                                                           Get:37 http://deb.freexian.com wheezy-lts-kernel/main amd64 Packages [11.8 kB]                                                                      Err http://debian.uberglobalmirror.com stretch InRelease                                                                                                Get:38 http://nsolid-deb.nodesource.com jessie/main amd64 Packages [1467 B]                                         Get:39 http://repo.mongodb.org jessie/mongodb-org/4.0/main amd64 Packages [16.0 kB]                                                        Ign http://deb.freexian.com wheezy-lts/contrib Translation-en                                                                              Ign http://deb.freexian.com wheezy-lts/main Translation-en                                                          Ign http://deb.freexian.com wheezy-lts/non-free Translation-en                                Ign http://deb.freexian.com wheezy-lts-kernel/main Translation-en                             Err http://debian.uberglobalmirror.com stretch-updates InRelease                                  Ign http://repo.mongodb.org jessie/mongodb-org/4.0/main Translation-en                        Ign http://nsolid-deb.nodesource.com jessie/main Translation-en         Err http://debian.uberglobalmirror.com stretch Release.gpg                Temporary failure resolving 'debian.uberglobalmirror.com'  Err http://debian.uberglobalmirror.com stretch-updates Release.gpg    Temporary failure resolving 'debian.uberglobalmirror.com'  Fetched 20.4 kB in 2s (8219 B/s)                  Reading package lists... Done  W: There is no public key available for the following key IDs:  112695A0E562B32A  W: Failed to fetch http://debian.uberglobalmirror.com/debian/dists/stretch/InRelease      W: Failed to fetch http://debian.uberglobalmirror.com/debian/dists/stretch-updates/InRelease      W: Failed to fetch http://debian.froxlor.org/dists/jessie/main/source/Sources  HttpError404    W: Failed to fetch http://debian.froxlor.org/dists/jessie/main/binary-amd64/Packages  HttpError404    W: Failed to fetch http://debian.uberglobalmirror.com/debian/dists/stretch/Release.gpg  Temporary failure resolving 'debian.uberglobalmirror.com'    W: Failed to fetch http://debian.uberglobalmirror.com/debian/dists/stretch-updates/Release.gpg  Temporary failure resolving 'debian.uberglobalmirror.com'    W: Some index files failed to download. They have been ignored, or old ones used instead.  

Version of debian:

No LSB modules are available.  Distributor ID: Debian  Description:    Debian GNU/Linux 8.11 (jessie)  Release:        8.11  Codename:       jessie  

What I've tried so far:

  • Entering unset http_proxy and unset https_proxy in the console
  • Changed the /etc/apt/sources.list to the following:
deb http://debian.uberglobalmirror.com/debian/ stretch main  deb-src http://debian.uberglobalmirror.com/debian/ stretch main    deb http://security.debian.org/ stretch/updates main contrib  deb-src http://security.debian.org/ stretch/updates main contrib    # stretch-updates, previously known as 'volatile'  deb http://debian.uberglobalmirror.com/debian/ stretch-updates main contrib  deb-src http://debian.uberglobalmirror.com/debian/ stretch-updates main contrib  
  • The following commands from here:
sudo cp /etc/apt/sources.list ~/   sudo wget "http://pastebin.com/raw.php?i=uzhrtg5M" -O /etc/apt/sources.list   sudo apt-get update  sudo rm /etc/apt/sources.list.d/ubuntu-extras.list  sudo apt-get update  
  • sudo apt-get upgrade and sudo apt-get upgrade -f from here.
  • apt-get clean

I have read lots of articles but none of the mentioned solutions worked for me. Any help would be appreciated

Auto input text to interactive "Dialog prompt"

Posted: 06 Apr 2021 08:30 AM PDT

I want to autoinput passphrase in gpg prompt for password. Its a Dialog box based prompt. Hence, echo pass | script, yes pass | script, script <<< herestring, named pipes not working.

I dont want to use expect. If any solution available plese answer

How to copy an entire line which matches the string and paste right after it with prefix?

Posted: 06 Apr 2021 10:14 AM PDT

I am trying to search for a particular line in a file using grep command and I am successful doing that.

Now I want to copy the entire line to a new line right after the original line. In other words, the original line should be followed by the new line with same content with some prefix.

For example: Original data :

Apple   Samsung  Nokia  HTC  

Say if I want the new data to look like

Apple  Samsung  prefix Samsung  Nokia  HTC  

Note: I have multiple patterns with Samsung, where ever I found that it should do the same.

I tried to grep and pipe with sed and I failed. Can anyone please help me with this?

Thanks

ldconfig does not include libs in /usr/lib/x86_64-linux-gnu

Posted: 06 Apr 2021 08:01 AM PDT

I need to use swrast_dri.so for Flutter but ldconfig is not locating it nor than others libs in /usr/lib/x86_64-linux-gnu.

Here my x86_64-linux-gnu.conf file:

# Multiarch support  /usr/local/lib/x86_64-linux-gnu  /lib/x86_64-linux-gnu  /usr/lib/x86_64-linux-gnu  

My ld.so.conf file:

include /etc/ld.so.conf.d/*.conf  

swrast_dri.so is under /usr/lib/x86_64-linux-gnu/dri/

Here a little part of ldconfig -p:

    libGLX.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libGLX.so.0      libGLU.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libGLU.so.1      libGLEW.so.2.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libGLEW.so.2.1      libGLESv2.so.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/libGLESv2.so.2      libGL.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libGL.so.1      libFLAC.so.8 (libc6,x86-64) => /lib/x86_64-linux-gnu/libFLAC.so.8      libEGL_mesa.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL_mesa.so.0      libEGL.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL.so.1      libDeployPkg.so.0 (libc6,x86-64) => /usr/lib/libDeployPkg.so.0      libCoinUtils.so.3 (libc6,x86-64) => /lib/x86_64-linux-gnu/libCoinUtils.so.3      libCoinMP.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libCoinMP.so.1      libClpSolver.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libClpSolver.so.1      libClp.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libClp.so.1      libCgl.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libCgl.so.1      libCbcSolver.so.3 (libc6,x86-64) => /lib/x86_64-linux-gnu/libCbcSolver.so.3      libCbc.so.3 (libc6,x86-64) => /lib/x86_64-linux-gnu/libCbc.so.3      libBrokenLocale.so.1 (libc6,x86-64, Système d'exploitation ABI : Linux 3.2.0) => /lib/x86_64-linux-gnu/libBrokenLocale.so.1      libBrokenLocale.so.1 (libc6, Système d'exploitation ABI : Linux 3.2.0) => /lib32/libBrokenLocale.so.1      libBrokenLocale.so (libc6,x86-64, Système d'exploitation ABI : Linux 3.2.0) => /lib/x86_64-linux-gnu/libBrokenLocale.so      ld-linux.so.2 (ELF) => /usr/lib/ld-linux.so.2      ld-linux.so.2 (ELF) => /lib32/ld-linux.so.2      ld-linux-x86-64.so.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2  

As you can see I don't get any libs from usr/lib/x86_64-linux-gnu

I already tried to delete ld.so.cache file and rebuild it with ldconfig command but it didn't change anything...

(Here why I need swrast_dri.so)

How to get my guest to keep the correct time and date?

Posted: 06 Apr 2021 09:39 AM PDT

I'm running windows 10 inside gnome boxes (on fedora) which, while kinda slow, works well enough.

However, after closing and reopening boxes, it appears that windows just continues where I left off. Now, of course that's what it should do, but it also keeps the time and date from where I left it and when I'm not connected to the internet, it can't grab the correct time from network.

Now, I can either set the correct time by hand, or always "correctly" shutdown and boot windows to fix it, but I was wondering if there's a way to provide a time server for windows/boxes guests inside the virtual network that boxes is running.

Reason I'm asking: I need windows for some software to read data from meteorological stations, so I'm in the sticks, not connected to the internet and this software apparently depends on correct system time to be able to download data. If my windows thinks it's one week ago, I can only download data from one week ago.

dc and standard input or heredoc with string command?

Posted: 06 Apr 2021 08:59 AM PDT

dc can read command from a file or/and from standard input.
If I want to print user input :

cat essai_dc  [enter a number : ]  n  ?  p    dc essai_dc     enter a number : 4    4  

Now, if I try with a heredoc :

dc <<EOF  > [enter a number : ]  > n  > ?  > p  > EOF      enter a number : dc: stack empty  

I get the same with standard input :

cat essai_dc | dc  enter a number : dc: stack empty  

The command ? get the p and execute it but the stack is empty.
Is it possible to get it to work (tell dc to wait for the input)

Power suspend not working in Void Linux

Posted: 06 Apr 2021 08:56 AM PDT

I am working on Void Linux with XFCE4 which is updated and otherwise working very well.

Earlier, when I pressed "suspend" button from XFCE4 log-out menu, the computer would suspend properly - screen goes blank, no disk activity and power button used change from ON to blinking state. Then on pressing spacebar, it would wake up, power button would become ON again and desktop would be restored on screen.

Recently, however, there is a problem. On pressing "suspend" button, the screen goes blank but disk activity continues and power button remains ON (not change to blinking). Moreover, on pressing spacebar, desktop is not restored and I have press to the restart button or switch off the computer and then switch on again.

Memory and swap status on my desktop can be seen from output of free command:

$ free -h                 total        used        free      shared  buff/cache   available  Mem:           3.8Gi       1.1Gi       2.2Gi        77Mi       569Mi       2.4Gi  Swap:           11Gi          0B        11Gi  

I tried to search the internet but found mainly pages which describe solutions involving systemd, but Void Linux has runit.

Since the computer goes off, I can check output of command: dmesg | tail

Where could be the problem and how can it be solved? Thanks for your help.

Edit: As suggested by @JiriB in comments, I tried zzz command:

zzz -n : gives proper response- sleep for a few seconds

zzz -z : produces result as described in my question above - blank screen but power still on, disk still working and not waking up on pressing spacebar. I have to restart the computer.

Is it possible to have two sources for a mount?

Posted: 06 Apr 2021 10:27 AM PDT

I have NAS which is accessible via both SMB and FTP. I currently have the share mounted on my Fedora 33 laptop using curlftpfs, but I'd like to know if it's possible to configure it to first try mounting the share using SMB and fall back to curlftpfs if that fails. This way it would mount using the much faster SMB protocol when I'm at home and only fall back to the slower FTP protocol when I'm not connected to my home network.

EDIT: I'm using SystemD Automount to manage the mount.

This is how my mounts are specified in etc/fstab:

dave:xxxxxxx@davef.dyndns-at-home.com/music /mnt/Music  fuse.curlftpfs  noauto,uid=1000,gid=1000,utf8,allow_other,_netdev,umask=133,x-systemd.automount,x-systemd.device-timeout=10 0 0  //192.168.1.201/music   /mnt/Music  smb3    noauto,uid=1000,gid=1000,_netdev,x-systemd.automount,x-systemd.device-timeout=10,credentials=/etc/music-creds   0 0    

;ls bash: syntax error near unexpected token `;'

Posted: 06 Apr 2021 10:33 AM PDT

after typing ;ls

I got this return - bash: syntax error near unexpected token `;'

how do I fix this?

Triple Boot Debian 10, Fedora 33 and Windows 10 with GPT and (U)EFI

Posted: 06 Apr 2021 10:30 AM PDT

Situation:

Hardware is Lenovo Laptop with:

-1 physical 1TB SSD disk

-UEFI BIOS (version H3ET65WW 1.02)

-BIOS Startup tab settings: UEFI/Legacy Boot- UEFI Only & CSM Support set to Yes

-Boot Priority order- 1.debian 2.fedora 3.Windows Boot Manager 4. ATA HDD0 Samsung SSD 1TB

Operating systems installed by chronological order:

Windows 10 fresh install and updated to 20H2 - NTFS (for Office and Windows only apps)    Fedora 33 with kernel 5.11 fresh install and updated -btrfs, GPT (for work-database server and Red Hat/Fedora only apps)    Debian 10 with kernel 4.19 fresh install - ext4, GPT (personal & for everything else)  

Problem: Debian's Grub does not recognize Fedora'a boot partition (although it is there). I understand why- It has not have access to it. Result-> can't boot Fedora

Desirable situation: Debian's or Fedora's Grub menu with Debian, Fedora and Windows entries

I can boot Debian 10 and Windows 10. As mentioned earlier, I can not boot into Fedora 33.

me@debian~$ sudo parted -l /dev/sda    Model: ATA Samsung SSD 870 (scsi)    Disk /dev/sda: 1000GB    Sector size (logical/physical): 512B/512B    Partition Table: gpt    Disk Flags:      Number Start End Size File system Name Flags    1 1049kB 106MB 105MB fat32 EFI System Partition boot, esp    2 106MB 123MB 16.8MB Microsoft reserved partition msftrees    3 123MB 266GB 265GB ntfs Basic data partition msftdata    5 266GB 267GB 1074MB ext4    6 267GB 577GB 311GB btrfs    7 577GB 578GB 700MB fat32 boot boot, esp    8 578GB 677GB 99.0GB ext4    9 677GB 982GB 305GB ext4    10 982GB 1000GB 17.5GB linux-swap(v1)    4 1000GB 1000GB 530MB ntfs hidden, diag    me@debian~$lsblk  NAME    MAJ:MIN RM  SIZE     RO TYPE    MOUNTPOINT  sda   8:0   0   931.5G    0 disk  |--sda1   8:1   0     100M    0 part    /boot/efi  |--sda2   8:2   0      16M    0 part  |--sda3   8:3   0   247.2G    0     part  |--sda4   8:4   0     505M    0 part  |--sda5   8:5   0       1G    0 part  |--sda6   8:6   0   289.5G    0 part  |--sda7   8:7   0     668M    0 part  |--sda8   8:8   0    92.2G    0 part    /  |--sda9   8:9   0   284.1G    0 part    /home  |--sda10  8:10  0    16.3G    0 part    [SWAP]      me@debian~$efibootmgr  BootCurrent: 000F  Timeout: 0seconds  BootOrder: 000F,0000,0001,0002,0003,000A,000E,000D,0008,0006,0007,0009,000B  Boot0000  Setup  Boot0001  Boot Menu  Boot0002  Diagnostic Splash Screen  Boot0003  Lenovo Diagnostics  Boot0004  Startup Interrupt Menu  Boot0005  Rescue and Recovery  Boot0006* USB CD  Boot0007  USB FDD  Boot0008* ATA HDD0  Boot0009  ATA HDD1  Boot000A* USB HDD  Boot000B  PCI LAN  Boot000C  MEBx Hot Key  Boot000D* Windows Boot Manager  Boot000E* Fedora  Boot000F* debian  

So, to summarize:

  1. sda1 is /boot/efi as fat32 with flags boot,esp
  2. sda2 is microsoft reserved partition with flag msftrees
  3. sda3 is windows basic data partition on ntfs with flag msftdata
  4. sda4 is windows ntfs with flags hidden and diag
  5. sda5 is fedora ext4 boot partition
  6. sda6 is fedora btrfs home and root partition
  7. sda7 is debian fat32 boot partition with flags boot and esp
  8. sda8 is debian ext4 root partition
  9. sda9 is debian ext4 home partition
  10. sda10 is swap partition
~$sudo os-prober   /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi    ~$sudo linux-boot-prober /dev/sda5  /dev/sda5:/dev/sda5::/vmlinuz-0-rescue-28a1491a109143e9bde2807e8a6e68fc:/initramfs-0-rescue-28a1491a109143e9bde2807e8a6e68fc.img:root=/dev/sda5  /dev/sda5:/dev/sda5::/vmlinuz-5.11.11-200.fc33.x86_64/initramfs-5.11.11-200.fc33.x86_64.img:root=/dev/sda5  /dev/sda5:/dev/sda5::/vmlinuz-5.8.15-301.fc33.x86_64:/initramfs-5.8.15-301.fc33.x86_64.img:root=/dev/sda5  

I understand why debian's grub doesn't "see" fedora's boot partition (permissions, right?). Is it fedora's btrfs format that causes debian's grub not to see fedora kernel (if so, should I reinstall fedora's root and home partion as ext4 filesystem?) Could I add fedora in debian's /etc/grub.d/40_custom file and will the debian/fedora update wipe out these entries (if so, what to add? Fedora's kernel file path?)

I'm new to UEFI&GPT setup and to btrfs. I've searched the web and arch's wiki on partitioning is very informative, but not applicable to this situation.

Any help or link to manual/tutorial is appreciated... If I have to, I can and will reinstall all 3 systems all over again, since there are do data on that laptop.

EDIT after these steps being done (see comments below post):

From Debian 10 did: sudo apt install lvm2

then: #grub-install --target=x86_64-efi --efi-directory=/boot/efi/EFI/fedora --bootloader-id=fedora --recheck

output: Found background image: /usr/share/images/desktop-base/desktop-grub.png Found linux image: /boot/vmlinuz-4.19.0-16-amd64 Found initrd image: /boot/initrd.img-4.19.0-16-amd64 Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi Adding boot menu entry for EFI firmware configuration done

So now grub (grub2) offers me only Fedora 33 and Windows 10 which I can both boot. But now I'CANT boot Debian. So booted into Fedora.

I then did: #os-prober and it finds Windows and Debian.

Then I did: sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

and it stated it has created entries for windows and debian. After reboot, same situation- only Fedora and Windows. But, in /boot/efi/EFI/grub.cfg , under BEGIN /etc/grub.d/30_os-prober section there is only Windows boot entry. menu_auto_hide variable (auto unhide) is set to 2.

How can I print output of ps command with its column name?

Posted: 06 Apr 2021 10:18 AM PDT

In the CLI of RHEL 7.6, ps command shows many columns of output. I can guess meanings of some of them but do know all of them. Can I show the results of ps command with its column name?

Manipulate linux workspaces with scripts

Posted: 06 Apr 2021 09:18 AM PDT

I want to write a script(s) that lets me manipulate Linux workspaces on my computers. I'm looking for compatibility with EWMH/NetWM compatible X Window Managers. I currently use wmctrl to move existing editor windows to desired workspace(s) with a script.

Now I would like to be able to get a list of current workspaces, so I can compare to my desired workspaces and be able to move to, add, or delete workspaces as necessary -- and do it all with scripts and not GUI tools or keyboard commands.

I've tried various search terms, but the best I can seem to find apply to Mac OS and that is using an unmaintained program.

Only first slot password is valid during decryption of boot device while all others are valid while testing to open a device

Posted: 06 Apr 2021 09:50 AM PDT

I made a full encryption setup of Ubuntu 20.04 LTS according to this article. Due to it is highly recommended to add further passphrases to avoid loosing all data due to unavailability of the initial passphrase, I did so, by adding several passphrases using cryptsetup luksAddKey /dev/sda1 command. To be fully sure, that I have done all right, I checked for the validness of each passphrase by running cryptsetup luksOpen --test-passphrase /dev/sda1 and all passphrases passed the test successfully.

The problem is that while booting and trying to unlock the master key (GPT) I can use only the first entered passphrase. Others are not working, while they are OK if checking it after system load by using cryptsetup luksOpen --test-passphrase /dev/sda1.

Are there any known issues regarding this have been ever heard before or maybe there are some things that were our of my scope?

UPDATE:

  1. There are no any strings within my /etc/crypttab file except of those, mentioned in the HOWTO article. Here they are:
LUKS_BOOT UUID=<UUID-VALUE> /etc/luks/boot_os.keyfile luks,discard  sda5_crypt UUID=<UUID-VALUE> /etc/luks/boot_os.keyfile luks,discard  
  1. According to systemd crypttab manual, if no key-slot option is used, then:

The default is to try all key slots in sequential order.

But for some reason this doesn't work.

How to resize partition with "raid" flag

Posted: 06 Apr 2021 09:10 AM PDT

Keep in mind that this question is not about how to resize/grow a RAID array or RAID partition.

I have a 4 TB partition (/dev/sdb1) on a 8 TB physical HDD (/dev/sdb). The partition has the flag raid because it is part of an incomplete RAID1 array. There is no other partition on that HDD.

$ sudo fdisk -l /dev/sdb  Disk /dev/sdb: 7,3 TiB, 8001563222016 bytes, 15628053168 sectors  Disk model: TOSHIBA HDWG180   Units: sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 4096 bytes  I/O size (minimum/optimal): 4096 bytes / 4096 bytes  Disklabel type: gpt  Disk identifier: 1F88C10B-74C7-B940-801A-556C5F5E2DA8    Device     Start        End    Sectors  Size Type  /dev/sdb1   2048 7814037134 7814035087  3,7T Linux RAID  

I want to resize that partition to use the full 8TB HDD without loosing the data in the partition.

If this would be a usual filesystem (e.g. ext4) I would know what to do. But with a Linux RAID type I am not sure if this is a filesystem or not. Or does the RAID1 on the higher level influence all that.

Of course a "simple" mdadm --grow does not work because the underlying partition (/dev/sdb1) is to small.

$ sudo mdadm --grow /dev/md0 --size=max  mdadm: component size of /dev/md0 has been set to 3906885447K  

Background info: The RAID1 currently has no second device/partition - it is missing. In the last consequence I want to grow the "higher-level" RAID1 partition (/dev/md0; assembled from /dev/sdb1 only, with a missing/failed/removed second device).

Turn off GNOME themeing/layouts in programs

Posted: 06 Apr 2021 09:51 AM PDT

I have a few applications that involve tabs to organize their content. Cockatrice and ReText seem to use gnome theming for themselves even though I am using MATE as my DE. This wouldn't be a problem except the tabs in GNOME I don't like at all. I know some applications such as Lutris is built for GNOME and their isn't a way to turn this off but in these cases I have looked up images and it isn't built into these apps. Is their some way to turn the GNOME styling off?

Here is an example with Retext: This is what is looks like on my computer

But I want it to look like this: This is what I found online

thread profiling and monitoring

Posted: 06 Apr 2021 08:18 AM PDT

how can I get lock time values specifically of the threads of any process? in linux.. I was using the command /proc/pid/stat but I am unable to determine which values are of lock time.

Use GNU Parallel when file has a single (long) line

Posted: 06 Apr 2021 10:16 AM PDT

I have a file which is an HTML document, containing a <table> I want to extract data from and output into a csv.

This file has 544609657 characters, is about 545 megabytes, all in a single line.

I managed to extract the data into a csv by using sed and making many string replacements, but I wanted to speed things up by using GNU parallel. Is this possible, considering it's a single line file?

My attempts below have not increased processing speed nor improved memory usage:

parallel -a table.html --pipepart 'sed -e [...etc.]' > table.csv  

Or

cat table.html | parallel --pipe 'sed -e [...etc.]' > table.csv  

I'm guessing the problem is because the file has a single line. If so, what strategies could I used to process the file more efficiently?

Command line for editing a configuration file value without an interactive editor

Posted: 06 Apr 2021 10:27 AM PDT

Many configuration files are based on the format Key value or Key=value with one line for each of them. Many packages provide a default configuration file where theses available configuration keys are already written with their default value and/or are commented.

I'm wondering if there is a tool that allows to change that kind of files without the need to open an interactive editor and more high level than sed (possibly built over it).

That would be something as simple as :

$ conftool file key value  

It would find the key in the file, remove the comment sign(s) if any, change the value and save the result.

sane, can't find my scanner (permission problem) even if I added udev rules unless i use sudo

Posted: 06 Apr 2021 09:37 AM PDT

My AIO Printer/Scanner is Canon E400 but I can't find my scanner as a normal user, only with sudo & scan is also work with sudo

~ cincinmasukmangkok@orangepizero  < sane-find-scanner                                                                                                       <<<      # sane-find-scanner will now attempt to detect your scanner. If the    # result is different from what you expected, first make sure your    # scanner is powered up and properly connected to your computer.      # No SCSI scanners found. If you expected something different, make sure that    # you have loaded a kernel SCSI driver for your SCSI adapter.    could not open USB device 0x1d6b/0x0001 at 008:001: Access denied (insufficient permissions)  could not open USB device 0x1d6b/0x0002 at 005:001: Access denied (insufficient permissions)  could not open USB device 0x1d6b/0x0001 at 007:001: Access denied (insufficient permissions)  could not open USB device 0x04a9/0x177a at 004:007: Access denied (insufficient permissions)  could not open USB device 0x1d6b/0x0002 at 004:001: Access denied (insufficient permissions)  could not open USB device 0x1d6b/0x0001 at 006:001: Access denied (insufficient permissions)  could not open USB device 0x1d6b/0x0002 at 003:001: Access denied (insufficient permissions)  could not open USB device 0x1d6b/0x0001 at 002:001: Access denied (insufficient permissions)  could not open USB device 0x1d6b/0x0002 at 001:001: Access denied (insufficient permissions)    # No USB scanners found. If you expected something different, make sure that    # you have loaded a kernel driver for your USB host controller and have setup    # the USB system correctly. See man sane-usb for details.      # Not checking for parallel port scanners.      # Most Scanners connected to the parallel port or other proprietary ports    # can't be detected by this program.      # You may want to run this program as root to find all devices. Once you    # found the scanner devices, be sure to adjust access permissions as    # necessary.    ~ cincinmasukmangkok@orangepizero  > scanimage -L    No scanners were identified. If you were expecting something different,  check that the scanner is plugged in, turned on and detected by the  sane-find-scanner tool (if appropriate). Please read the documentation  which came with this software (README, FAQ, manpages).    ~ cincinmasukmangkok@orangepizero  < sudo sane-find-scanner                                                                                                  <<< [sudo] password for cincinmasukmangkok:      # sane-find-scanner will now attempt to detect your scanner. If the    # result is different from what you expected, first make sure your    # scanner is powered up and properly connected to your computer.      # No SCSI scanners found. If you expected something different, make sure that    # you have loaded a kernel SCSI driver for your SCSI adapter.    found USB scanner (vendor=0x04a9 [Canon], product=0x177a [E400 series]) at libusb:004:007    # Your USB scanner was (probably) detected. It may or may not be supported by    # SANE. Try scanimage -L and read the backend's manpage.      # Not checking for parallel port scanners.      # Most Scanners connected to the parallel port or other proprietary ports    # can't be detected by this program.    ~ cincinmasukmangkok@orangepizero  < sudo scanimage --format=png > test.png                                                                                  <<<    ~ cincinmasukmangkok@orangepizero 33s  >  

I also added this to /lib/udev/rules.d/60-libsane.rules but it still doesn't work

SUBSYSTEM=="usb", ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="177a", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"  

failed to start postfix.service: Unit not found

Posted: 06 Apr 2021 09:02 AM PDT

I just got my own VPS with CentOS 7, and I'm trying to install GitLab on it. I'm following the instructions listed here. My problem is the command systemctl start postfix. I did the yum install postfix, and this is what resulted:

enter image description here

Then when I run the start command, I get the following error:

failed to start postfix.service: Unit not found

I've tried to Google the error, but all the results I've found were other issues. I'm new to this. Am I missing something really silly?

Disk io stat “averaged” over a period of time

Posted: 06 Apr 2021 08:08 AM PDT

I am using the iostat utility on my RedHat Linux server to monitor the performance of a disk. When I use "iostat -xd sdh 1", I get the perf result printed every one second. When I use "iostat -xd sdh 5", I get the perf result printed every five second. My feeling is the latter command is printing a snapshot of the perf every five second, rather than averaging over the past 5 seconds. Am I correct in my understanding?

If so, is there a way I can make iostat print the perf. number averaged over n seconds, or is there some other utility that will do that.

Currently, the perf number is fluctuating within a range, and I want to get a somewhat "stable" number. I am hoping that averaging over a period of time will give me such a number.

Thank you, Ahmed.

Visualizing dependencies coded up in makefiles as a graph

Posted: 06 Apr 2021 10:28 AM PDT

Closely related to How to display dependencies given in a makefile as a tree? But the answers given there is not satisfactory (i.e. do not work).

Is there a tool to visualize the Directed Acylic Graphs (DAGs) coded up in standard Makefiles? eg, a shell-script for post-processing through Unix pipes can be an acceptable solution as well (maybe there is a pandoc filter to convert MakeFiles to graphviz or LaTeX).

I don't strictly need a tool that directly typesets this graphical visualisation? Just a common file-format translation of the makefile to a graph-viz file or something similar would suffice.

Can't get RealVNC to work with LightDM

Posted: 06 Apr 2021 10:06 AM PDT

As far as I can tell GDM3 is incompatible with RealVNC so I uninstalled it and I installed LightDM. However now I can't get anywhere when I try to connect to RealVNC.

What I did before was run:

sudo -u localuser vncserver-virtual  

... and it opened up a VNC server on port 5901 to which I could connect. I still can, but now it displays the message:

Xsession: unable to start X session --- no .xsession file, no .Xsession file, no session managers, no window managers, and no terminal emulators found; aborting.  

I'm guessing I need to make changes to my /etc/vnc/xstartup.custom file to somehow get X to detect LightDM? Its current contents seems centered around GDM:

#!/bin/sh    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources  xsetroot -solid grey    if [ -f /usr/bin/gnome-session ]; then    # Some gnome session types won't work with Xvnc, try to pick a sensible    # default.    for SESSION in "ubuntu-2d" "2d-gnome" "gnome-classic" "gnome-fallback"; do      if [ -f /usr/share/gnome-session/sessions/$SESSION.session ]; then        DESKTOP_SESSION=$SESSION; export DESKTOP_SESSION        GDMSESSION=$SESSION; export GDMSESSION        STARTUP="/usr/bin/gnome-session --session=$SESSION"; export STARTUP      fi    done  fi    unset SESSIONBIN  XTERM_COMMAND="xterm -geometry 80x24+10+10 -ls"    if   [ -x /etc/X11/Xsession ]; then SESSIONBIN="/etc/X11/Xsession"  elif [ -x /etc/X11/xdm/Xsession ]; then SESSIONBIN="/etc/X11/xdm/Xsession"  elif [ -x /etc/X11/xinit/Xsession ]; then SESSIONBIN="/etc/X11/xinit/Xsession"  elif [ -x /etc/X11/gdm/Xsession ]; then SESSIONBIN="/etc/X11/gdm/Xsession gnome-session"  elif [ -x /etc/gdm/Xsession ]; then SESSIONBIN="/etc/gdm/Xsession gnome-session"  elif [ -x /etc/kde/kdm/Xsession ]; then SESSIONBIN="/etc/kde/kdm/Xsession"  elif [ -x /usr/dt/bin/Xsession ]; then    XSTATION=1    DTXSERVERLOCATION=local    export XSTATION DTXSERVERLOCATION    SESSIONBIN="/usr/dt/bin/Xsession"  elif [ -x /usr/dt/bin/dtsession ]; then SESSIONBIN="/usr/dt/bin/dtsession"  elif which twm > /dev/null 2>&1; then    $XTERM_COMMAND &    SESSIONBIN="twm"  fi    if [ "x${SESSIONBIN}" = "x" ]; then    echo "No session located; just starting a terminal"    $XTERM_COMMAND    echo "Terminal closed with return code $?"  else    echo "Starting session: $SESSIONBIN"    $SESSIONBIN    echo "Session terminated with return code $?"  fi    vncserver-virtual -kill $DISPLAY  

Any ideas what I need to change to get my RealVNC session to connect to LightDM?

The name > org.freedesktop.PolicyKit1 was not provided by any .service files

Posted: 06 Apr 2021 10:27 AM PDT

When attempting to launch system-config-users from command line, I get the following warning, and the tool does not open. I'm using CentOS 7 with Mate 1.8.1.

WARNING **: Error enumerating actions: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files

Error checking for authorization org.freedesktop.policykit.exec: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files

yum list polkit*

Installed Packages  polkit.x86_64   0.112-5.el7 @anaconda  polkit-devel.x86_64 0.112-5.el7 @base      polkit-docs.noarch 0.112-5.el7 @base      polkit-gnome.x86_64 0.105-6.el7 @epel      polkit-pkla-compat.x86_64 0.1-4.el7  @anaconda  

What is missing from my system to cause this error?

How to configure swap space after system installation?

Posted: 06 Apr 2021 09:52 AM PDT

I've installed Debian Wheezy; after installation completed, I realized that I forgot to set the swap memory. So now, how can I configure the swap space?

No comments:

Post a Comment