LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "Device is busy" message when trying to resize filesystem on encrypted LVM (https://www.linuxquestions.org/questions/linux-newbie-8/device-is-busy-message-when-trying-to-resize-filesystem-on-encrypted-lvm-4175510705/)

rokyo 07-10-2014 12:55 PM

"Device is busy" message when trying to resize filesystem on encrypted LVM
 
Hi there,

I tried to extend my /home-partition on my CentOS 7.0.1406 installation today, following this guide: http://www.thomas-krenn.com/de/wiki/...C3%B6%C3%9Fern (which is in German)

Everything went perfectly until the step where I resize the underlying filesystem (which is ext4) with the command:
Code:

resize2fs -p /dev/dm-1
(which is what "df -h" showed me as the mount point for my /home-partition).

The error I get is:
Code:

"Invalid magic number in the superblock when trying to open /dev/dm-1. Cannot find a valid filesystem superblock."
(the message is in German, but this is what it translates to...)

When I check my logical volumes with "lvdisplay", it displays:

Code:

lvdisplay
  --- Logical volume ---
  LV Path                /dev/cl/00
  LV Name                00
  VG Name                cl
  LV UUID                pTp5dI-u3LX-wxdF-CUIl-rAsO-m18u-LHuLva
  LV Write Access        read/write
  LV Creation host, time localhost, 2014-07-09 18:14:35 +0200
  LV Status              available
  # open                1
  LV Size                200,00 GiB
  Current LE            51200
  Segments              3
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    8192
  Block device          253:0

so, I tried:

Code:

resize2fs -p /dev/cl/00
also, which produced a slightly different error:

Code:

"Device or resource is busy when trying to open /dev/cl/00. Cannot find a valid filesystem superblock."

The system is CentOS 7.0.1406, freshly installed, with the following partition layout (two HDDs -> 500GB on /dev/sda and 20GB SSD on /dev/sdb):

/dev/sda1 -> Windows boot partition
/dev/sda2 -> Windows partition
/dev/sda3 -> Linux SWAP partition
/dev/sda4 -> extended partition containing:
/dev/sda5 -> ext4 partition for CentOS 6.5 (my old system, still running in triple boot here)
/dev/sda6 -> the first partition I added to the LVM
/dev/sda7 -> the second partition I added to the LVM
/dev/sda8 -> ext4 encrypted LVM volume containing the /home-partition of CentOS 7

/dev/sdb1 -> CentOS 7's root-partition (not part of the LVM, not encrypted)


Why do I get the errors? Because my /home is mounted when I try resizing? But I thought ext4 can do online resize? Or is it because it's encrypted?

Thanks in advance! ;)

rokyo

rokyo 07-11-2014 02:35 AM

I also tried booting into CentOS (but not logging into the Gnome session), then switching to a new shell by hitting "ctrl-alt-f2", logging in as root, unmounting the /dev/dm-1 partition with
Code:

umount /dev/dm-1
(which shows no error messages) and then trying to resize again with
Code:

resize2fs -p /dev/dm-1
, but that doesn't work, either. Same error message... even though the partition is (supposedly) unmounted now. :(


All times are GMT -5. The time now is 08:09 PM.