1850678 Members
3737 Online
104055 Solutions
New Discussion

Re: CHMOD - Lvol

 
Rafael Mendonça Braga
Regular Advisor

CHMOD - Lvol

Hello there!
I'm using HP-UX 11i.

How to set the "b" in the beggining of a filesystem information and what does it means?

br--r----- 1 root sys 64 0x010001 Sep 25 2004 lvol1

Thanks,

Rafael M. Braga
5 REPLIES 5
Uday_S_Ankolekar
Honored Contributor

Re: CHMOD - Lvol

It stands for block-type, a device file.
mknod command is used to create device file.

What exactly you want to do?

-USA
Good Luck..
Rafael Mendonça Braga
Regular Advisor

Re: CHMOD - Lvol

Hello!!!

The lvol was created without the "b" in the beggining of the filesystem information, and someone told me that without that letter it won't work correctly... I would like to know what that "b" means, and how can I set it!

Thanks,

Rafael M. Braga
A. Clay Stephenson
Acclaimed Contributor

Re: CHMOD - Lvol

Normally these device nodes are not created manually but are done as part of an lvcreate or vgimport command. Be very careful and know what you are doing, if creating these on your own. My approach would be to vgexport and do a vgimport to rebuild these device nodes. If you must do this then find the 'group' device node under /dev/vg00 and note the first two hex digits the minor device number.

e.g. 64 0x020000 group

lvol1 will use those same first two digits and 0001 as the last 4 hex digits; lvol2 will use 0002, and so on.

To create /dev/vg02/lvol1 assuming the "group" minor device number is 0x020000,
rm /dev/vg02/lvol1 # this assumes lvol1 is a regular file (missing the 'b' or 'c').
mknod /dev/vg02/lvol2 b 64 0x020001 # block device
mknod /dev/vg02/rlvol2 b 64 0x020001 # character device
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: CHMOD - Lvol

You cannot set the bit at the beginning of the permission string with chmod. The bit at the beginning of the permissions indicates what the item in question is.

d = Directory
b = Block device
c = Character device
l = Link
p = Pipe
- = File

There are others as well.

That bit is determined by how the item is created. You would have to create the 'b' or 'c' with mknod as stated above.

Also pay attention to what Clay talked about. The /dev/vg*/lvol* and /dev/vg*/rlvol* devices are normally created when a logical volume is created. Those are not files that you would normally mess with.
Bill Hassell
Honored Contributor

Re: CHMOD - Lvol

Logical volumes are created with a pair of device files, one is called the character device and the other is the block device. The block device file will use the kernel's blocking or caching driver. The character device file is used by raw (direct I/O) tasks such as newfs. The raw or character device will have the same name as the lvol but with the letter 'r' in front as in lvol1 and rlvol1.

When you use SAM or lvcreate, both device files are created automatically. Someone has been playing around with the device files, something that should not be done without a lot of training. Rather than guessing how to fix all the problems, you should use lvremove (or SAM) to get rid of the problem lvol and recreate it again. Using the proper tools will always create the correct device file pairs.


Bill Hassell, sysadmin