CentOS mount LAN disk, //192.168.1.223/ is not a valid block device - centos

I'm using CentOS today, I want mount my work LAN disk in /mnt/P,
use:mount -t cifs //192.168.1.223/ /mnt/P -o username=centos,password=FFM#centos,domain=ffm.local
early, I used this order in Ubuntu, it's OK, but today, in CentOS, tell me:
mount: //192.168.1.223/ is not a valid block device
I don't know much about CentOS, please, thx~

You need install cifs-utils package
sudo yum install cifs-utils

Related

Can't find postgresql client installed using yum on cent os 7 running in docker

I have a CentOS image running in Docker. I don't have root access to this image. The only thing I can control is the dockerfile.
Anyway, I have the yum command to install postgresql in my dockerfile. From the output I can see that the yum command is succeeding.
Now when I ssh into the host, and type "psql", the console outputs with cmd not found. Most likely due to path not being set. But since I don't have root access, my hands are tied. I tried to use locate command but then again CentOS doesn't seem to have that command by default.
My question is two folds:
How do I locate postgresql client on a CentOS docker image that I don't have root access to? I tried the expected default paths like /usr/lib or /etc/ but no luck.
Is there anything I can print/echo on my dockerfile that could help me get the location of postgresql client?

mount: unknown filesystem type 'vmhgsf'

I'm trying to mount my windows shared folder in centOS using command:
~mount -t vmhgfs .host:/shared-folder /var/www/html/
Unfortunatelly I get :
~monut: unknown filesystem type 'vmhgfs'
error. I tried to use:
~/usr/bin/vmhgfs-fuse /mnt
but mountpoint is not empty...
Is there any way to mount this folder on VMware player?
Cyb
Try this:
vmhgfs-fuse .host:/shared-folder /var/www/html/
you might need to use sudo on this
Working from a MacBook Pro running Big Sur and using VMware to host the virtual machine with CentOS 7 operating system. Had issues with loading in shared folders after VMware tools were installed. What worked for me is to use this exact command:
sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
Hope this saves others the trouble of tracking down this solution.
The below is working perfectly fine for me. Might be useful for someone.
Already I have mapped the required folders in "SharedFolder" settings. But it was not showing up.
Additionally running this command shares the windows directories.
sudo /usr/bin/vmhgfs-fuse .host:/ /home/user/win -o subtype=vmhgfs-fuse,allow_other

Qemu Debian x86 on RaspberryPi

I want to create i386 environment with QEMU and chroot on Raspberry Pi.
I am using Raspberry Pi ver B, but I guess it should not matter much which version is used.
So far I did:
apt-get install qemu qemu-user qemu-user-static binfmt-support debootstrap binutils
Then I mounted chroot directory to /tmp/mnt and ran:
sudo debootstrap --foreign --arch i386 buster ./ http://deb.debian.org/debian/
Then I mounted:
mount -t sysfs /sys /tmp/mnt/sys/
mount -t proc /proc /tmp/mnt/proc/
mount –bind /dev /tmp/mnt/dev/
mount –bind /dev/pts /tmp/mnt/dev/pts/
mount –bind /dev/shm /tmp/mnt/dev/shm/
Now when I try to run second stage of debootstrap:
sudo chroot ./ ./debootstrap/debootstrap --second-stage
I get the following error message:
W: Failure trying to run: /sbin/ldconfig
W: See //debootstrap/debootstrap.log for details
I checked the debootstrap/debootstrap.log:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
Indeed when I try sudo chroot ./ ./sbin/ldconfig I get same Seg fault.
But when I try sudo chroot ./ ./bin/bash it works.
I am not sure what should be my next step.
I guess it is something related to my qemu config or verison (I am using version 2.8.1(Debian 1:2.8+dfsg-6+deb9u4)). I checked many threads about similar issues, but I could not find one which would help me to find the solution.
OK, I think I figured it out.
It works when I select stretch as Debian version in debootstrap command.
sudo debootstrap --foreign --arch i386 stretch ./ http://deb.debian.org/debian/
Now when I think about it more, it makes sense. I guess running i386 Debian in chroot does not provide full separation from host OS (I mounted proc, sys, etc.).
I had the exact same problem running Raspbian Buster; the problem went away when chrooting Debian Stretch.
So somehow ldconfig from the i386 repository is not working with the qemu-i386-static emulator on buster, but it IS working on stretch!
Has nothing to do with the host system....

How to upgrade psql on Amazon ec2?

I'm aware of how one can upgrade the PostgreSQL version on an RDS instance by using the management console's point-and-click. However, doing so leaves me with mismatched client and server psql versions. I want to upgrade the psql client on my ec2 instance. How does one do so?
You can also use amazon-linux-extras command to install new major versions of postgresql, for example:
$ sudo amazon-linux-extras install postgresql13
$ psql --version
psql (PostgreSQL) 13.3
Note that previous versions will remain enabled, but you can explicitly disable them (even though there's no uninstall, try yum to get rid of packages):
$ sudo amazon-linux-extras disable postgresql11
Tested on:
$ hostnamectl | grep -E -w 'Operating|Kernel|Architecture'
Operating System: Amazon Linux 2
Kernel: Linux 4.14.243-185.433.amzn2.aarch64
Architecture: arm64
The exact solution is going to vary depending on your AMI, but here's what worked for me on Amazon Linux:
sudo yum erase postgresql92 -y
sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm -y
sudo yum install postgresql96 postgresql96-devel -y
sudo ln -sf /usr/pgsql-9.6/bin/pg_config /usr/bin/
You might not need the last step unless you're trying to get the pg gem working in Ruby on Rails.

Resolve hostnames with arch linux on a RaspberryPi

I have a Pi that runs hostapd and dhcpd on arch linux to create it's own land with the Pi's (routers) IP being 10.0.0.1. This uses the wlan0 interface and it only serves as a standalone router running a web server.
Once I connect to the Pi, I use 10.0.0.1 to display the web pages, but I want to use a hostname such as firepi. I have tried using dnsmasq, but I haven't been successful. Any help would be greatly appreciated especially if you can give me some detailed examples as I am a novice.
The purpose of this system is that I have created a web app that you can use to ignite fireworks over WiFi at a safe distance. I would just like the convenience of using a hostname instead of the IP address.
I must add that I will more than likely be using an iPhone to connect to the server, should this affect anything.
Not too sure how or why but this is what I did and it is successfully working now, so this is just for future users who may need a similar setup to mine.
First I installed hostapd and dhcpd and made sure they were working. Next I changed '/etc/hostname' to firepi and the '/etc/hosts' and added '10.0.0.1 firepi'. Then I installed dnsmasq, and set the interface to wlan0, and finally added '10.0.0.1 firepi' to '/etc/resolv.conf'.
After a full reboot, I joined the network on my iPhone, navigated to firepi and sure enough, it worked!
Thanks to the other users for their advice and tips.
You can use avahi on Arch as well to resolve your hostname:
sudo pacman -S avahi nss-mdns
Start the avahi daemon:
sudo systemctl enable avahi-daemon.service
sudo systemctl start avahi-daemon.service
Edit /etc/nsswitch.conf
sudo vim /etc/nsswitch.conf
Change the line:
hosts: files myhostname dns
to
hosts: files myhostname mdns_minimal [NOTFOUND=return] dns
Reboot
Note: don't forget to add .local to your hostname.
See also:
http://blog.pixxis.be/post/77285636682/resolve-hostname-with-arch-linux-on-a-raspberry-pi
If you just want to be able to use "firepi" as hostname to connect to it, you can simply add it to your /etc/hosts file using the syntax "IP host".
To make it as easy as possible, run this command as root:
echo "10.0.0.1 firepi" >> /etc/hosts
That'll do the trick.
Can you try avahi ?
sudo apt-get install avahi-daemon and
sudo apt-get install avahi-browse
I've successfully used that on Raspian. Unless you change the hostname using
sudo raspi-config you will access via raspberrypi.local
Note that if you plan to access the RPi from Windows you will need to install Bonjour Service first(if you have iTunes intalled, you might have those, run services.msc and check if the Bonjour Service is started)
Another note: On a friend's iphone I've installed a generic vnc client and had x11vnc running on the RPi and succesfully managed to connect to the RPi (since avahi-daemon was installed)