Showing posts with label filesystem. Show all posts
Showing posts with label filesystem. Show all posts

Wednesday, June 11, 2008

Extend a Redhat LVM filesystem

Slightly simpler case than the earlier one ... this is just something I'd like to have spelled out for convenience, since I do it so rarely.

We want to fix this:
/dev/mapper/prod_dg-volOracle
4128448 3918544 192 100% /u01

And we have this:
[root@woogie /]# lvscan
...
ACTIVE '/dev/prod_dg/volOracle' [4.00 GB] inherit
[root@woogie /]# pvscan
...
PV /dev/sdb1 VG prod_dg lvm2 [273.22 GB / 139.44 GB free]


So we do this:
[root@woogie /]# lvextend --size 6G /dev/prod_dg/volOracle /dev/sdb1
Extending logical volume volOracle to 6.00 GB
Logical volume volOracle successfully resized


(lvextend usage: lvextend --size nG logical-path physical-path ... Use the paths from pvscan and lvscan, and absolute or relative sizes denoted by K,M,G, etc.)


[root@woogie /]# umount /u01
[root@woogie /]# resize2fs /dev/prod_dg/volOracle 6G
resize2fs 1.35 (28-Feb-2004)
Please run 'e2fsck -f /dev/prod_dg/volOracle' first.

[root@woogie /]# e2fsck -f /dev/prod_dg/volOracle
e2fsck 1.35 (28-Feb-2004)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/prod_dg/volOracle: 27925/524288 files (3.4% non-contiguous), 996131/1048576 blocks
[root@woogie /]# resize2fs /dev/prod_dg/volOracle 6G
resize2fs 1.35 (28-Feb-2004)
Resizing the filesystem on /dev/prod_dg/volOracle to 1572864 (4k) blocks.
The filesystem on /dev/prod_dg/volOracle is now 1572864 blocks long.

[root@woogie /]# mount /u01

Wednesday, April 30, 2008

ACLs are enabled by default in Solaris 2.9

... and probably earlier. This says ACLs were "integrated" into 2.5 back in 1995, which might explain why they're finicky in 2.9. Anyway, I don't want to look this up again and won't believe myself next time it matters, so here I am using ACLs in / on 2.9, where I wouldn't have enabled them on purpose.
buzz> cd /
buzz> touch foo
buzz> setfacl -r -m u:karen:rwx foo
buzz> su karen
buzz> id
uid=1234(karen) gid=200(staff)
buzz> ls -l foo
-rw-r--r--+  1 root     other          0 Apr 30 11:35 foo
buzz> echo "bar" > foo
buzz> ls -l foo
-rw-r--r--+  1 root     other          4 Apr 30 11:36 foo
Here's an entry from a similar blog describing getfacl/setfacl usage on Solaris. Red Hat usage is similar, except: # There's no -r flag, because recalculation is implicit # Partial default ACLs are allowed. (You can set a default user, for example, without having to set defaults for group, other and mask.)