PDA

View Full Version : resize2fs open: Is a directory while opening /home



COKEDUDE
22nd July 2011, 01:38 AM
Can anyone explain this error to me? I am trying to use resize2fs to resize an ext4 partition. I did unmount the partition and I don't have any files opened or anything like that. Here is the full output.


# resize2fs -p /home 3G
resize2fs 1.41.12 (17-May-2010)
open: Is a directory while opening /home

scott32746
22nd July 2011, 01:48 AM
Hello,

-p option is to print

-p Prints out a percentage completion bars for each resize2fs operation, so that
the user can keep track of what the program is doing.

-P Print the minimum size of the filesystem and exit.


I do not think you use /home ( mountpoint ) need something like /dev/sda2

May want to look at the website
http://www.howtoforge.com/linux_resizing_ext3_partitions

If you are under LVM you may want to look here
http://www.apolonio.com/docs/html/examples.html

jpollard
22nd July 2011, 01:49 AM
/home is not a device partition. It is a directory.

It may even be a mounted directory.

Next, resize2fs does not manipulate partitions - it only alters filesystems that are on a partition. The partition must be resized before you can resize the filesystem (well, if going larger).

COKEDUDE
22nd July 2011, 02:34 AM
Hello,

-p option is to print

-p Prints out a percentage completion bars for each resize2fs operation, so that
the user can keep track of what the program is doing.

-P Print the minimum size of the filesystem and exit.


I do not think you use /home ( mountpoint ) need something like /dev/sda2

May want to look at the website
http://www.howtoforge.com/linux_resizing_ext3_partitions

If you are under LVM you may want to look here
http://www.apolonio.com/docs/html/examples.html

This is what I meant to do.


resize2fs -p /dev/mapper/VG-lv_home 22G

The first link I found and I was also looking at this link. I just wasn't paying close enough attention to realize my mistake. Thx for the help and pointing out that other link :).

http://pubmem.wordpress.com/2010/09/16/how-to-resize-lvm-logical-volumes-with-ext4-as-filesystem/


/home is not a device partition. It is a directory.

It may even be a mounted directory.

Next, resize2fs does not manipulate partitions - it only alters filesystems that are on a partition. The partition must be resized before you can resize the filesystem (well, if going larger).

I unmounted it :). I was shrinking.

stevea
22nd July 2011, 03:23 AM
I think you'd prefer

system-config-lvm
and
gparted (for non LVM)

COKEDUDE
22nd July 2011, 06:10 PM
I think you'd prefer

system-config-lvm
and
gparted (for non LVM)

Its LVM. I am trying to learn this for a server. The server of course does not have a gui.

stevea
22nd July 2011, 06:14 PM
Its LVM. I am trying to learn this for a server. The server of course does not have a gui.

You can still" ssh -Y" into the server from a system with a display. Just b/c you have no local Xserver does not mean you can't run X clients.

JPollard has pointed to the command line technique BUT you must be very careful calculating block sizes and count and the order of commands or you'll end up with a ruined file system. That's why higher level tools exist. For someone who doesn't recognize yet where a block device vs a mountpoint spec is needed - you are very likely to make a serious mistake.


Also you can create some tiny file systems as files (use losetup) and play with these before destroying the real file system.
Here's an example (post 10 on) for raid, but you can use the method to create a 'toy' LVM to play with.
http://forums.fedoraforum.org/showthread.php?t=183911