Homestead: lmm status - Volume group "mysql" not found

Created on 20 Feb 2021  Â·  5Comments  Â·  Source: laravel/homestead

Versions

  • Vagrant: v2.2.14
  • Provider: Parallels v13.3.1
  • Homestead: v12.0.0

Host operating system

macOS v10.14.6 - Mojave

Homestead.yaml

The issue can be reproduced with the default Homestead.yaml (only change is the provider to parallels):

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: parallels

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/test
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/public

databases:
    - homestead

features:
    - mysql: true
    - mariadb: false
    - postgresql: false
    - ohmyzsh: false
    - webdriver: false

Vagrant destroy & up output

GitHub Gist

Expected behavior

No issue when using sudo lmm status command.

Actual behavior

vagrant@homestead:~$ sudo lmm status
Active snapshot: /homestead-vg/master

Database snapshots:
  mysql-master
  root        
  swap_1      
  Volume group "mysql" not found
  Cannot process volume group mysql

% used by MySQL databases.
(standard_in) 1: syntax error
/opt/lmm/functions.sh: line 48: [: -eq: unary operator expected

Steps to reproduce

  1. SSH into the box: ssh vagrant
  2. Run this command: sudo lmm status

References

Note

There is a message in the vagrant up output: homestead: Invalid feature: mysql, but that is not supposed to be related. The issue is the same even if I completely remove the features section from Homestead.yaml.

Most helpful comment

I had the same problem on a fresh install of Homestead 12.1.1 (with MariaDB 10.5.9), and the two commands you suggested fixed the syntax error issue.

However, I can't get much further than that. I've tried a few commands, but without any luck:

â–¶ sudo lmm status
Active snapshot:

Database snapshots:
  mysql-master
  root
  swap_1

2.65% used by MySQL databases.
â–¶ sudo lmm checkout master
Snapshot /dev/homestead-vg/master does not appear to exist
â–¶ sudo lmm checkout mysql-master
is the currently active database.
Setting /homestead-vg/mysql-master as the active database.
rm: cannot remove '/var/lib/mysql': Is a directory
ln: failed to create symbolic link '/var/lib/mysql/mysql-master': File exists
â–¶ sudo lmm checkout root
is the currently active database.
Setting /homestead-vg/root as the active database.
rm: cannot remove '/var/lib/mysql': Is a directory
ln: failed to create symbolic link '/var/lib/mysql/root': File exists

All 5 comments

Will have to look into this. I thought the LVM was sorted out in #1415

Sorry it's taken so long.

Try running these commands:

sudo mv /opt/lmm /opt/old-lmm
sudo git clone -b ubuntu-20.04 https://github.com/svpernova09/lmm.git /opt/lmm

With those changes I'm seeing:

vagrant@homestead:/opt/lmm$ sudo lmm status
Active snapshot: master

Database snapshots:
  mysql-master
  root
  swap_1

2.65% used by MySQL databases.
vagrant@homestead:/opt/lmm$

Do other lmm commands work as expected?

I had the same problem on a fresh install of Homestead 12.1.1 (with MariaDB 10.5.9), and the two commands you suggested fixed the syntax error issue.

However, I can't get much further than that. I've tried a few commands, but without any luck:

â–¶ sudo lmm status
Active snapshot:

Database snapshots:
  mysql-master
  root
  swap_1

2.65% used by MySQL databases.
â–¶ sudo lmm checkout master
Snapshot /dev/homestead-vg/master does not appear to exist
â–¶ sudo lmm checkout mysql-master
is the currently active database.
Setting /homestead-vg/mysql-master as the active database.
rm: cannot remove '/var/lib/mysql': Is a directory
ln: failed to create symbolic link '/var/lib/mysql/mysql-master': File exists
â–¶ sudo lmm checkout root
is the currently active database.
Setting /homestead-vg/root as the active database.
rm: cannot remove '/var/lib/mysql': Is a directory
ln: failed to create symbolic link '/var/lib/mysql/root': File exists

Using the above branch:

$ sudo lmm status
Active snapshot: master

Database snapshots:
  mysql-master
  root
  swap_1

2.65% used by MySQL databases.
$ sudo lmm branch prod
  WARNING: Sum of all thin volume sizes (128.00 GiB) exceeds the size of thin pool homestead-vg/thinpool (64.00 GiB).
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
  Logical volume "prod" created.
unknown mount option `nofail'
valid options:
  rw         mount read write (default)
  ro         mount read only
  uid       =<arg> default file owner user id
  gid       =<arg> default file owner group id
  ttl       =<arg> time to live for dentries & inode info
  dcachettl =<arg> time to live for dentries
  inodettl  =<arg> time to live for inode info
  maxiopages=<arg> max buffer size for I/O with host
  dirbuf    =<arg> directory buffer size (0 for default)
  cache     =<arg> cache mode: none, strict (default), read, readwrite
  iocharset =<arg> i/o charset (default utf8)
  convertcp =<arg> convert share name from given charset to utf8
  dmode     =<arg> mode of all directories
  fmode     =<arg> mode of all regular files
  umask     =<arg> umask of directories and regular files
  dmask     =<arg> umask of directories
  fmask     =<arg> umask of regular files
mount: /homestead-vg/prod: special device /dev/homestead-vg/prod does not exist.
$ sudo lvs
  LV           VG           Attr       LSize   Pool     Origin       Data%  Meta%  Move Log Cpy%Sync Convert
  mysql-master homestead-vg Vwi-aotz--  64.00g thinpool              2.65
  prod         homestead-vg Vwi---tz-k  64.00g thinpool mysql-master
  root         homestead-vg -wi-ao----  54.92g
  swap_1       homestead-vg -wi-ao---- 976.00m
  thinpool     homestead-vg twi-aotz--  64.00g                       2.68   11.89
$ mount|grep mysql
/dev/mapper/homestead--vg-mysql--master on /homestead-vg/master type ext4 (rw,relatime,errors=remount-ro,stripe=16)

@JackWH

IME the error is that mariadb installer remove the link to the vg, instead should remove the folders and files inside

https://github.com/laravel/homestead/blob/2f41a54f6b8d0035b0d0f8f5d022a9b865ea1c5f/scripts/features/mariadb.sh#L33

must be:

rm -rf /var/lib/mysql/*
Was this page helpful?
0 / 5 - 0 ratings

Related issues

steveheinsch picture steveheinsch  Â·  3Comments

mtpultz picture mtpultz  Â·  4Comments

svpernova09 picture svpernova09  Â·  5Comments

dorinniscu picture dorinniscu  Â·  4Comments

it-can picture it-can  Â·  3Comments