Cannot run docker engine in ubuntu18 - mysql

First I run a offical MySQL image with Docker, suddently I can't connect to MySQL with
"Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost".
when I run docker ps, the contianer is runnning, but I can't exec -it it.So i try to restart docker and i got this :
Job for docker.service failed because the control process exited with error code.
See systemctl status docker.service and journalctl -xe for details.
when I try to start docker engine by systemctl start docker
● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2022-11-25 10:24:22 CST; 9s ago Docs: https://docs.docker.com Process: 952 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 952 (code=exited, status=1/FAILURE)
then I try "sudo dockerd", Console tells me follow
chmod /var/lib/docker: read-only file system
this is my df -T -H output:
Filesystem Type Size Used Avail Use% Mounted on udev devtmpfs 126G 0 126G 0% /dev tmpfs tmpfs 26G 4.1M 26G 1% /run /dev/sda2 ext4 879G 150G 685G 18% / tmpfs tmpfs 126G 0 126G 0% /dev/shm tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs tmpfs 126G 0 126G 0% /sys/fs/cgroup /dev/loop1 squashfs 1.5M 1.5M 0 100% /snap/gnome-system-monitor/181 /dev/loop2 squashfs 64M 64M 0 100% /snap/core20/1695 /dev/loop3 squashfs 347M 347M 0 100% /snap/gnome-3-38-2004/119 /dev/loop0 squashfs 56M 56M 0 100% /snap/core18/2620 /dev/loop5 squashfs 415M 415M 0 100% /snap/gnome-42-2204/29 /dev/loop4 squashfs 347M 347M 0 100% /snap/gnome-3-38-2004/115 /dev/loop6 squashfs 2.7M 2.7M 0 100% /snap/gnome-calculator/920 /dev/loop7 squashfs 512K 512K 0 100% /snap/gnome-characters/781 /dev/sda1 vfat 379M 4.4M 375M 2% /boot/efi /dev/loop8 squashfs 64M 64M 0 100% /snap/core20/1634 /dev/loop9 squashfs 92M 92M 0 100% /snap/gtk-common-themes/1535 /dev/loop11 squashfs 2.7M 2.7M 0 100% /snap/gnome-system-monitor/178 /dev/loop12 squashfs 128K 128K 0 100% /snap/bare/5 /dev/loop14 squashfs 6.4M 6.4M 0 100% /snap/curl/1256 /dev/loop15 squashfs 768K 768K 0 100% /snap/gnome-characters/741 /dev/loop16 squashfs 768K 768K 0 100% /snap/gnome-logs/115 /dev/loop17 squashfs 71M 71M 0 100% /snap/core22/275 /dev/loop18 squashfs 219M 219M 0 100% /snap/gnome-3-34-1804/72 /dev/loop19 squashfs 82M 82M 0 100% /snap/gtk-common-themes/1534 /dev/loop20 squashfs 2.5M 2.5M 0 100% /snap/gnome-calculator/884 /dev/loop21 squashfs 48M 48M 0 100% /snap/snapd/17336 /dev/loop22 squashfs 73M 73M 0 100% /snap/core22/310 /dev/loop23 squashfs 6.4M 6.4M 0 100% /snap/curl/1113 /dev/loop24 squashfs 640K 640K 0 100% /snap/gnome-logs/112 /dev/loop25 squashfs 219M 219M 0 100% /snap/gnome-3-34-1804/77 /dev/sdc2 ext4 15T 637G 14T 5% /data2 /dev/sdb1 ext4 880G 394G 441G 48% /home /dev/sdc1 ext4 15T 586G 14T 5% /data1 tmpfs tmpfs 26G 32K 26G 1% /run/user/121 tmpfs tmpfs 26G 52K 26G 1% /run/user/1000 /dev/loop26 squashfs 50M 50M 0 100% /snap/snapd/17576 /dev/loop13 squashfs 447M 447M 0 100% /snap/gnome-42-2204/44 /dev/loop27 squashfs 56M 56M 0 100% /snap/core18/2632
I'm wondering why /var/ib/docker become a read-only file system,and how can i run docker engine

Since you haven't mentioned how you have installed Docker, I'm assuming that you installed using snap and that your OS is ubuntu.
If that's the case, try to remove docker from snap:
snap remove docker
And then remove the docker directory:
rm -R /var/lib/docker
sudo apt-get remove docker docker-engine docker.io
Install official docker: https://docs.docker.com/install/linux/docker-ce/ubuntu/

Related

Why running PhpStorm 2021 I got error of lacking memory in my OS?

Working in PhpStorm 2021 I got error of lacking memory in IDE in my Kubuntu 20 (I installed it 3-4 months ago). I ignored it but after restarting I failed to run the OS.
$ /opt/PhpStorm-2021.1.4/PhpStorm-211.7628.25/bin/phpstorm.sh
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size
I cleared all directories inside of /home/user/.cache/JetBrains as I supposed that my cache raised to big size so I cleared space in root of my OS.
I upgraded my OS with the following command:
sudo apt-get update
sudo apt-get upgrade
but after restarting I still got the same error.
I have in my OS:
$ free
total used free shared buff/cache available
Mem: 8067380 1399884 4747912 198804 1919584 6202076
Swap: 2104476 0 2104476
$ lsb_release -d; uname -r; uname -i
Description: Ubuntu 20.04.3 LTS
5.11.0-37-generic
x86_64
$ df -HT
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 4.1G 0 4.1G 0% /dev
tmpfs tmpfs 827M 2.1M 825M 1% /run
/dev/sdb2 ext4 53G 28G 23G 55% / // I HAVE A LOT OF FREE SPACE
tmpfs tmpfs 4.2G 0 4.2G 0% /dev/shm
tmpfs tmpfs 5.3M 4.1k 5.3M 1% /run/lock
tmpfs tmpfs 4.2G 0 4.2G 0% /sys/fs/cgroup
/dev/sdb7 ext4 30G 13G 16G 44% /var
/dev/sdb1 ext4 339M 208M 106M 67% /boot
/dev/loop0 squashfs 155M 155M 0 100% /snap/chromium/1864
/dev/sdb8 fuseblk 399G 151G 248G 38% /mnt/_work_sdb8
/dev/loop2 squashfs 59M 59M 0 100% /snap/core18/2253
/dev/loop1 squashfs 140M 140M 0 100% /snap/chromium/1878
/dev/loop4 squashfs 261M 261M 0 100% /snap/gnome-3-38-2004/87
/dev/loop7 squashfs 66M 66M 0 100% /snap/core20/1328
/dev/loop3 squashfs 59M 59M 0 100% /snap/core18/2284
/dev/loop6 squashfs 173M 173M 0 100% /snap/gnome-3-28-1804/161
/dev/loop5 squashfs 132k 132k 0 100% /snap/bare/5
/dev/loop8 squashfs 69M 69M 0 100% /snap/gtk-common-themes/1515
/dev/loop9 squashfs 69M 69M 0 100% /snap/gtk-common-themes/1519
/dev/loop10 squashfs 46M 46M 0 100% /snap/snapd/14295
/dev/loop11 squashfs 66M 66M 0 100% /snap/core20/1270
/dev/loop12 squashfs 46M 46M 0 100% /snap/snapd/14549
/dev/sda6 fuseblk 237G 122G 115G 52% /mnt/Work_sda6
/dev/sda1 fuseblk 65G 58G 7.2G 89% /mnt/Win_sda1
/dev/sda8 fuseblk 628G 626G 2.7G 100% /mnt/Media_sda8
tmpfs tmpfs 827M 17k 827M 1% /run/user/1000
I found file /home/user/.config/JetBrains/PhpStorm2021.2/phpstorm64.vmoptions
-Xmx984m
-Xms128m
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-ea
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlinx.coroutines.debug=off
-Dsun.tools.attach.tmp.only=true
Has it relative options? I tried to modify it (I googled some refs in net) :
-Xms5096m
-Xmx4096m
-XX:NewSize=1024m
-XX:MaxNewSize=1512m
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-ea
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlinx.coroutines.debug=off
-Dsun.tools.attach.tmp.only=true
Restated OS and the same error.
I have a SSD (sdb and on Linux partitions are located on it) and HDD (sda) on my laptop and I do not use any virtual machines...
What could raise this error and how it can be fixed ?

Unable to start mysql on ubuntu

I'm trying to mysql, but I'm receiving this error:
sudo /etc/init.d/apache2 start
* Starting web server apache2 *
ubuntu#ip-172-31-19-47:/var/www/html/anunciolocal$ sudo /etc/init.d/mysql start
* /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full!
When I checked my memory:
ubuntu#ip-172-31-19-47:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 996M 12K 996M 1% /dev
tmpfs 201M 344K 200M 1% /run
/dev/xvda1 16G 15G 307M 98% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 1001M 0 1001M 0% /run/shm
none 100M 0 100M 0% /run/user
overflow 1.0M 992K 32K 97% /tmp
How do I solve it?
Try running it this way
sudo service mysql stop
sudo service mysql start
/etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full!
this is why you cant start mysql
please clear /dev/xvda1 the disk has no enough space

How can I create a custom sized disk using LXC

Good day,
I have been looking through a lot of documentation and nothing really appears to confirm how to expand the disk size of the the LXC containers that I am spinning up..
Here is what I have tried so far,
I warn you the items below look unrelated, but confirm my thoughts that it is and should be possible to alter the disk size.
LXC how to change network adapters
I followed the document with hopes that I could modify the size of the / and judging from this question it looks like it is possible...
https://askubuntu.com/questions/779609/lxd-container-disk-and-block-i-o-limits-edit-its-a-zfs-pool-limit
I tried doing this and It does write to the config , but the configuration never takes.
lxc profile device set tuleapprofile root size 20GB
lxc launch -p tuleapprofile images:centos/6/amd64 tuleap
TULEAP PROFILE
lxc profile show tuleapprofile
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
size: 20GB
type: disk
name: tuleapprofile
used_by: []
df -h
8.9G 188M 8.8G 3% /
none 492K 0 492K 0% /dev
udev 3.9G 0 3.9G 0% /dev/full
udev 3.9G 0 3.9G 0% /dev/null
udev 3.9G 0 3.9G 0% /dev/random
udev 3.9G 0 3.9G 0% /dev/tty
udev 3.9G 0 3.9G 0% /dev/urandom
udev 3.9G 0 3.9G 0% /dev/zero
udev 3.9G 0 3.9G 0% /dev/fuse
udev 3.9G 0 3.9G 0% /dev/net/tun
tmpfs 100K 0 100K 0% /dev/lxd
tmpfs 100K 0 100K 0% /dev/.lxd-mounts
tmpfs 3.9G 0 3.9G 0% /dev/shm
All I want is to have / in the LXC containers be larger (by 20 G ) so I can install what I need. how can I do this. The method doesn't really matter , but I would like to have this.
Thanks

mysql select query "No Space Left On Device"

My system is using Ubuntu with mysql database:
I have a complex mysql select query to run.
mysql -u root -p myDB < query.sql
But when I try to run it it always gives me:
ERROR 3 (HY000) at line 1: Error writing file
'/mnt/disk/tmp/MY0Wy7vA' (Errcode: 28 - No space left on device)
I have 11 GB free on disk and while the query is running, I keep track of it using
df -h
and
df -hi
to keep track of inodes
and I don't see any decrease in disk space while the query is running. All the time there is always 11 GB free on disk where the tmp folder is located.
This is the output of df -h:
ubuntu#ip-10-0-0-177:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 799M 57M 742M 8% /run
/dev/xvda1 30G 24G 5.4G 82% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/xvdf1 50G 39G 11G 80% /mnt/disk
tmpfs 799M 0 799M 0% /run/user/1000
This is the output of df -aTh:
Filesystem Type Size Used Avail Use% Mounted on
/dev/xvdf1 ext4 50G 39G 11G 80% /mnt/disk
Take a look at the part of the error that indicate it’s actually writing to /tmp (see below)
: Error writing file '/mnt/disk/tmp/MY0Wy7vA
In some Linux distributions, /tmp is mounted as a tmpfs (ramdisk), so even if your disk has plenty of space you can get a "no space" error if you try to write too much there.
To investigate about the mount, try
$ cat /proc/mounts
OR
$ cat /proc/self/mounts
Or better yet
df - aTh
df -h /tmp
To see hidden ones, try
du -sc * .[^.]* | sort -n
Among other things you can try making MySQL use a different temp directory, or to not use tmpfs for /tmp
If TMPDIR is not set in my.cnf, MySQL uses the system default which is usually /tmp
You can change the MySQL tmp dir as the following suggests:
Changing the tmp folder of mysql
Credits ::
https://github.com/LogBlock/LogBlock/issues/540

GitLab Click to deploy boot disk size

On the Gitlab Click2Deploy in Google Compute engine, there is a Boot Disk Size field that defaults to 100gb.
However df -h reveals that the boot disk is partitioned to 10gb.
Is this normal, or a bug?
[lol#gitlab-ydzp ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 10G 2.4G 7.7G 24% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.2M 1.8G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
The image used to create the boot disk has a partition size of 10G. There is another 90G available in your disk as unpartitioned space. Please follow the steps described in the link below to repartition your disk: Repartitioning a root persistent disk