Open-CAS / open-cas-linux

Open CAS Linux
https://open-cas.com
BSD 3-Clause "New" or "Revised" License
224 stars 82 forks source link

Handle missing /etc/mtab and modify output #1514

Closed Deixx closed 4 weeks ago

Deixx commented 2 months ago

resolves https://github.com/Open-CAS/open-cas-linux/issues/1515

Output after modifications:

# lsblk
...
vdc          disk
└─cas1-1     disk /tmp/mnt2
vdd          disk
└─cas1-2     disk
  ├─cas1-2p1 part
  ├─cas1-2p2 part /tmp/mnt1
  ├─cas1-2p3 part
  └─cas1-2p4 part /tmp/mnt3
# casadm -L
type    id   disk       status    write policy   device
cache   1    /dev/vdb   Running   wt             -
├core   1    /dev/vdc   Active    -              /dev/cas1-1
└core   2    /dev/vdd   Active    -              /dev/cas1-2
# casadm -T -i 1
Can't stop cache instance 1 due to mounted devices:
/dev/cas1-2p2
/dev/cas1-1
/dev/cas1-2p4
# casadm -R -i 1 -j 1
Can't remove core 1 from cache 1 due to mounted devices:
/dev/cas1-1
# casadm -R -i 1 -j 2
Can't remove core 2 from cache 1 due to mounted devices:
/dev/cas1-2p2
/dev/cas1-2p4