resize2fs continually fails with "open: No such file or dir:

Issues related to hardware problems
Post Reply
eprivia
Posts: 1
Joined: 2015/07/13 18:53:46

resize2fs continually fails with "open: No such file or dir:

Post by eprivia » 2015/07/13 18:58:09

I have dynamically increase a logical volume for a CentOS Linux system a dozen times. But this one server REFUSES to expand any logical volumes.

Here is the error I get no matter what I try:
resize2fs 1.41.12 (17-May-2010)
open: No such file or directory while opening /dev/mapper/vg_kraken-lv_root

Do I need to completely unmount root to extend this?

Here are the steps I followed:

[root@kraken ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (14019-30394, default 14019):
Using default value 14019
Last cylinder, +cylinders or +size{K,M,G} (14019-30394, default 30394): +20G
Command (m for help): p

Disk /dev/sdb: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x332b4f39

Device Boot Start End Blocks Id System
/dev/sdb1 1 10100 81128218+ 8e Linux LVM
/dev/sdb2 10101 11406 10490445 8e Linux LVM
/dev/sdb4 11407 30394 152521110 5 Extended
/dev/sdb5 11407 14018 20980858+ 8e Linux LVM
/dev/sdb6 14019 16630 20980858+ 83 Linux

Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): 8e
Changed system type of partition 6 to 8e (Linux LVM)
Command (m for help): p

Disk /dev/sdb: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x332b4f39

Device Boot Start End Blocks Id System
/dev/sdb1 1 10100 81128218+ 8e Linux LVM
/dev/sdb2 10101 11406 10490445 8e Linux LVM
/dev/sdb4 11407 30394 152521110 5 Extended
/dev/sdb5 11407 14018 20980858+ 8e Linux LVM
/dev/sdb6 14019 16630 20980858+ 8e Linux LVM


[root@kraken ~]# vgextend vg_kraken /dev/sdb6
Physical volume "/dev/sdb6" successfully created
Volume group "vg_kraken" successfully extended

[root@kraken ~]# lvextend -l+100%FREE /dev/vg_kraken/root /dev/sdb6
Size of logical volume vg_kraken/root changed from 329.81 GiB (84432 extents) to 349.82 GiB (89554 extents).
Logical volume root successfully resized

[root@kraken ~]# resize2fs /dev/vg_kraken/root
resize2fs 1.41.12 (17-May-2010)
open: No such file or directory while opening /dev/mapper/vg_kraken-lv_root

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: resize2fs continually fails with "open: No such file or

Post by TrevorH » 2015/07/13 20:31:25

Try running the resize2fs under strace and direct its logging to a file that you can read afterwards. Something like strace -f -o /tmp/resize.txt resize2fs ...

Oh, one obvious question: are you sure this LV is formatted with ext* and not xfs?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: resize2fs continually fails with "open: No such file or

Post by aks » 2015/07/14 17:57:26

Did you active the LVM after expanding?
And yes, don't resize root while it's mounted.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: resize2fs continually fails with "open: No such file or

Post by gerald_clark » 2015/07/14 18:21:13

ext filesystems expand just fine while mounted. They only need to be umounted to shrink.

basskleff
Posts: 28
Joined: 2013/12/21 01:02:46

Re: resize2fs continually fails with "open: No such file or

Post by basskleff » 2015/07/28 01:58:43

Stupid question. Are you sure you are giving the right argument to your final "resize2fs" command?
Should it not be
# resize2fs /dev/mapper/vg_kraken-lv_root
??
On my system, I tried the resize2fs on a non-root vg, without any of the the vgextend/lvextend work.
root@BK-Bacula-SV ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root
25G 3.9G 20G 17% /
tmpfs 3.9G 80K 3.9G 1% /dev/shm
/dev/sda3 477M 62M 390M 14% /boot
/dev/mapper/vg_root-lv_usr
13G 3.3G 8.4G 28% /usr
/dev/mapper/vg_root-lv_var
7.8G 983M 6.4G 14% /var
/dev/sr0 502M 502M 0 100% /media/HARD_DAYS_NIGHT
/dev/mapper/vg_backups-lv_backups
1.6T 112G 1.5T 8% /backups

Now I picked backups.
So let's say I do your kind of syntax:[root@BK-Bacula-SV ~]# resize2fs /dev/vg_backups/backups
resize2fs 1.41.12 (17-May-2010)
open: No such file or directory while opening /dev/vg_backups/backups <----SAME AS YOU

But, instead specify the "mapper" dev name:

[root@BK-Bacula-SV ~]# resize2fs /dev/mapper/vg_backups-lv_backups
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 434379776 blocks long. Nothing to do!

Well, the command got there.

Post Reply