Unable to access fsx shared volume after ubuntu 18.04 reboot - ubuntu-18.04

Previously, I had a fsx volume mounted on /shared directory.
However, Ubuntu 18.04 + fsx has some bug which causes reboot of the instance to unmount the fsx volume

Temporary solution:
Mount the fsx volume again
wget -O - https://fsx-lustre-client-repo-public-keys.s3.amazonaws.com/fsx-ubuntu-public-key.asc | sudo apt-key add -
sudo bash -c 'echo "deb https://fsx-lustre-client-repo.s3.amazonaws.com/ubuntu bionic main" > /etc/apt/sources.list.d/fsxlustreclientrepo.list'
sudo apt update -y
sudo apt install -y lustre-client-modules-$(uname -r)
sudo mount -t lustre -o noatime,flock fs-<id of the fsx>.fsx.us-east-1.amazonaws.com#tcp:/fsx /shared
ubuntu#<>:~$ ls /shared/
DeepLearningExamples checkpoint checkpoints checkpoints-1.data-00000-of-00001 checkpoints-1.index conda_tf25 conda_tf25_hvd deep-learning-models nccl_hosts
However, cleaner solution would not require this re-mounting of fsx volume after instance reboot.

Related

How to stop greengrass core?

I have installed greengrass core software and started it via:
sudo tar -xzvf greengrass-OS-architecture-1.11.0.tar.gz -C /
sudo tar -xzvf hash-setup.tar.gz -C /greengrass
cd /greengrass/certs/
sudo wget -O root.ca.pem https://www.amazontrust.com/repository/AmazonRootCA1.pem
cd /greengrass/ggc/core/
sudo ./greengrassd start
Verified that process is started via:
ps aux | grep PID-number
ps aux | grep -E 'greengrass.*daemon'
How to stop greengrass core?
For this, you need to run the following commands,
cd /greengrass-root/ggc/core/
sudo ./greengrassd stop

Cannot upgrade from Ubuntu 18.10 to 19.10

When running the command sudo do-release upgrade I'm facing the following errors:
Checking package manager
Can not upgrade
An upgrade from 'cosmic' to 'eoan' is not supported with this tool.
Since 18.10 no longer supported you can upgrade manually to 19.04
mkdir /tmp/upgrade
cd /tmp/upgrade
wget http://old-releases.ubuntu.com/ubuntu/dists/disco-updates/main/dist-upgrader-all/current/disco.tar.gz
tar -xvf disco.tar.gz
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
/etc/apt/sources.list change all links prefix to -> http://old-releases.ubuntu.com/
sudo python3 dist-upgrade.py
Then upgrade to 19.10
sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list
sudo sed -i -e 's|cosmic|eoan|g' /etc/apt/sources.list
sudo apt update
sudo apt upgrade
I just experienced the whole process of upgrading from 18.10 to 20.04LTS. Key steps are first upgrading from 18.10(cosmic) to 19.04(disco), then 19.10(eoan), finally 20.04LTS(focal).
Upgrade from 18.10 to 19.04. First, we have to manually download disco updates:
mkdir /tmp/upgrade
cd /tmp/upgrade
wget http://old-releases.ubuntu.com/ubuntu/dists/disco-updates/main/dist-upgrader-all/current/disco.tar.gz
tar -xf disco.tar.gz
Now, modify /etc/apt/sources.list(Tip: you'd better save the original sources.list as a backup). This file in Ubuntu 18.10 is like this:
However, "archive.ubuntu.com" has been dead, so we have to replace these links by "old-releases.ubuntu.com", then run dist-upgrade.py in current directory, which is extracted from disco.tar.gz:
sudo sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo sed -i 's/cosmic/disco/g' /etc/apt/sources.list # some answers may forget this
sudo python3 dist-upgrade.py
Note that if you forget to replace "cosmic" with "disco", when running this script, it may throw this dialogue box:
Don't worry, choose "Yes", just like it said, it will update all "cosmic" to "disco" entries.
When this script succeeds, reboot your system and now you have Ubuntu 19.04(disco). Your /etc/apt/sources.list should be like this:
Upgrade from 19.04 to 19.10. Again, replace "disco" to "eoan" in /etc/apt/sources.list. Now you can run apt for updating:
sudo sed -i 's/cosmic/eoan/g' /etc/apt/sources.list
sudo apt update
sudo apt upgrade
If everything goes well, reboot your system and you got 19.10(eoan)! If you just want 19.10, feel free to skip step 3, it's for users who want 20.04 LTS.
Upgrade from 19.10 to 20.04 LTS. This is quite easy, just use Ubuntu Software Updater, it will do everything for you. It took me about 2-3 hours to download and install all updates.

How to install nexus on ubuntu-18.04

I need help in installing nexus-oss on ubuntu18.04. I am not able to find any apt-get commands on internet.
I tried to search for nexus packages in "sudo apt-get search nexus", but could not get a proper nexus version package.
I have browsed over the net, where the commands are available for centos7 but not for Debian os.
In sonatype documentation, the steps are present to create repository manager on ubuntu, is it the same as installing nexus on ubuntu?
Install Java
$ sudo apt-get update
$ sudo apt install openjdk-8-jre-headless -y
Download Nexus
$cd /opt
$ sudo wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.16.1-02-unix.tar.gz
$ sudo tar -zxvf nexus-3.16.1-02-unix.tar.gz
$ sudo mv /opt/nexus-3.16.1-02 /opt/nexus
As a good security practice, it is not advised to run nexus service as root. so create a new user called nexus and grant sudo access to manage nexus services.
$ sudo adduser nexus
Set no password for nexus user and enter below command to edit sudo file
$sudo visudo
Add the below line and Save.
nexus ALL=(ALL) NOPASSWD: ALL
Change file and owner permission for nexus files
$ sudo chown -R nexus:nexus /opt/nexus
$ sudo chown -R nexus:nexus /opt/sonatype-work
Add nexus as a service at boot time
Open /opt/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following.
$ sudo vim /opt/nexus/bin/nexus.rc
run_as_user="nexus" (file shold have only this line)
Add nexus as a service at boot time
$ sudo ln -s /opt/nexus/bin/nexus /etc/init.d/nexus
Log in as a nexus user and start service
$ su - nexus
$ /etc/init.d/nexus start
Check the port is running or not using netstat command
$ sudo netstat -plnt
Allow the port 8081 and access the nexus http://:8081
Login as a min default username and password is admin/admin123

QEmu-ARM-Ubuntu: CPU1: failed to boot: -38

How to fix "CPU1: failed to boot: -38" issue in QEmu?
I am hosting Ubuntu 16.04 on Virtual Box from Windows 10. Inside that Ubuntu 16.04, there is QEmu emulating ARM processor, running Ubuntu Trusty (14.04). When the ARM-Ubuntu boots, it prints to console "CPU1: failed to boot: -38" and something similar multiple times. Is it a matter of some command-line switch to QEmu, or configuration files? Or is it a bug or lack of support of QEmu ARM emulation inside another VM?
Effectively the ARM-Ubuntu uses only 1 core out of 6 available in the physical machine and the middle virtual machine.
To setup ARM-Linux on QEmu I mostly followed these steps. I had to do something differently, e.g. because Ubuntu Sauce is no more available. Specifically the steps I did are:
# 1) setup the rootfs
sudo apt-get install qemu-user-static qemu-system-arm
mkdir vexpress
cd vexpress
mkdir qemu-img
# Create 8-GB image
dd if=/dev/zero of=./vexpress-8G.img bs=8M count=1024
sudo losetup -f ./vexpress-8G.img
sudo mkfs.ext4 /dev/loop0
sudo mount /dev/loop0 qemu-img
# Bootstrap Ubuntu Trusty armhf rootfs in the qemu-img directory
# For Ubuntu versions later than Trusty some commands fail
# For Ubuntu versions before Saucy there is no port to ARM
# Ubuntu Saucy is not supported anymore
sudo qemu-debootstrap --arch=armhf trusty qemu-img
sudo cp `which qemu-arm-static` qemu-img/usr/bin/
# setup serial console, apt repositories and network
sudo chroot qemu-img
sed 's/tty1/ttyAMA0/g' /etc/init/tty1.conf > /etc/init/ttyAMA0.conf
echo "deb http://ports.ubuntu.com trusty main restricted multiverse universe" > /etc/apt/sources.list
apt-get update
echo -e "\nauto eth0\niface eth0 inet dhcp" >> /etc/network/interfaces
# root password
passwd
# 2) pick and install a kernel
# Fix locale problems http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue
locale
sudo locale-gen "be_BY.UTF-8"
sudo locale-gen "en_US"
sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales
apt-get install wget ca-certificates
wget https://launchpad.net/ubuntu/+archive/primary/+files/linux-image-3.13.0-24-generic-lpae_3.13.0-24.46_armhf.deb
dpkg -i linux-image-3.13.0-24-generic-lpae_3.13.0-24.46_armhf.deb
# So far I'm getting the following warnings:
# Warning: cannot read table of mounted file systems: No such file or directory
# warning: failed to read mtab
# !!! press CTRL+D to exit the chroot
^D
# 3) Boot it up
# copy kernel, initrd and dtb files
sudo cp qemu-img/boot/vmlinuz-3.13.0-24-generic-lpae .
sudo cp qemu-img/boot/initrd.img-3.13.0-24-generic-lpae .
sudo cp qemu-img/lib/firmware/3.13.0-24-generic-lpae/device-tree/vexpress-v2p-ca15-tc1.dtb .
# umount the rootfs img
sudo umount qemu-img
sudo chmod 777 vmlinuz-3.13.0-24-generic-lpae
sudo chmod 777 initrd.img-3.13.0-24-generic-lpae
sudo chmod 777 vexpress-v2p-ca15-tc1.dtb
sudo chmod 777 vexpress-8G.img
# http://unix.stackexchange.com/questions/167165/how-to-pass-ctrl-c-in-qemu
# Allow Ctrl+C and Ctrl+Z on guest, changing them on host to Ctrl+] and Ctrl+[
stty intr ^]
stty susp ^j
qemu-system-arm --drive format=raw,if=sd,file=vexpress-8G.img -kernel vmlinuz-3.13.0-24-generic-lpae -initrd initrd.img-3.13.0-24-generic-lpae -M vexpress-a15 -serial stdio -m 2048 -append 'root=/dev/mmcblk0 rw mem=2048M raid=noautodetect rootwait console=ttyAMA0,38400n8 devtmpfs.mount=0' -dtb ./vexpress-v2p-ca15-tc1.dtb
# Still getting error: "CPU1: failed to boot: -38"
The specific machine you're emulating (vexpress-v2p-ca15-tc1) is a dual-core one, so the kernel will try to bring up the secondary CPU it sees described in the DTB you're passing. However, since QEMU is only emulating a single CPU, the secondary naturally fails to come online on account of not existing.
The message in and of itself is perfectly harmless, but if you're allergic to error messages, just add maxcpus=1 to the kernel command line to prevent Linux even trying to bring up any secondary cores. If you really want to emulate both cores, pass the -smp 2 option to QEMU, although it may well result in more emulation overhead and be slower overall.

PostgreSQL installation failed on Ubuntu 14.04

I recently uninstalled postgresql from my computer. I tried to install it again but I faced some problems. I tried to fully uninstall it again like this:
I found al the packages related to postgres:
$ dpkg -l | grep postgres
Them I removed all the packages and related folders :
$ sudo apt-get --purge remove postgresql postgresql-9.3 postgresql-client-9.3 postgresql-client-common postgresql-common postgresql-contrib-9.3
$ sudo rm -rf /var/lib/postgresql/
$ sudo rm -rf /var/log/postgresql/
$ sudo rm -rf /etc/postgresql/
I've tried to install it again, but after the installation I can't access postgres user.
$ sudo apt-get install postgresql postgresql-contrib
$ sudo -i -u postgres
sudo: unable to change directory to /home/postgres: No such file or directory
If I access root I can access postgres but this is what happens:
$ sudo su -
$ su - postgres
No directory, logging in with HOME=/
postgres#rafael-pc:/$ psql
psql (9.3.9)
Type "help" for help.
postgres=# \q
could not save history to file "/home/postgres/.psql_history": No such file or directory
I have no idea what is happening. I've tried to uninstall it many times but I always have some kind of error when I install it back.
Just a guess here, but it sure looks to me like the problem is that there isn't a /home/postgres directory. I'm not sure what may have happened in your uninstall process to remove that, but it looks like that's the cause of the error in both of the steps you list.
Can you try this (or some approximation of these steps, which create that directory and make sure it's owned by the postgres user)?
# sudo mkdir /home/postgres
# sudo chown postgres /home/postgres

Resources