general question on null device
-
- Posts: 36
- Joined: 2017/03/14 10:01:39
general question on null device
hi,
I need a null device in a different location. the default location is /dev/null.
Can I create additional null device in a specific folder.
/db2/null
this will be a null device which db2 users alone can use.
I do not want to use the default null device, since all users can use it.
is that possible to have multiple null devices like that? how do I configure that?
why I need such a requirement is a very complicated thing. I do not want to discuss that at least for now.
thanks,
harish pathangay
I need a null device in a different location. the default location is /dev/null.
Can I create additional null device in a specific folder.
/db2/null
this will be a null device which db2 users alone can use.
I do not want to use the default null device, since all users can use it.
is that possible to have multiple null devices like that? how do I configure that?
why I need such a requirement is a very complicated thing. I do not want to discuss that at least for now.
thanks,
harish pathangay
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: general question on null device
I guess you can create a udev rule for this task.
Re: general question on null device
Sure, mknod /db2/null c 1 3
Where I got that c 1 3 magic? See ls -l /dev/null
Where I got that c 1 3 magic? See ls -l /dev/null
-
- Posts: 36
- Joined: 2017/03/14 10:01:39
Re: general question on null device
I was able to create the device, but permissions is a issue.
crw-rw-rw-. 1 root root 1, 3 Sep 26 12:52 /dev/null
crw-r--r--. 1 root root 1, 3 Sep 26 13:05 db2null
how to get the file permissions to rw and ownership to db2user.
I am dba not a unix person. so I offer my apologies for my lack of knowledge.
google also did not help much.
crw-rw-rw-. 1 root root 1, 3 Sep 26 12:52 /dev/null
crw-r--r--. 1 root root 1, 3 Sep 26 13:05 db2null
how to get the file permissions to rw and ownership to db2user.
I am dba not a unix person. so I offer my apologies for my lack of knowledge.
google also did not help much.
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: general question on null device
Yeah, it seems mknod is way better approach.
When you create your /db2/null device you can set the file permission bits:
When you create your /db2/null device you can set the file permission bits:
Here is an example:-m, --mode=MODE
set file permission bits to MODE, not a=rw - umask
Code: Select all
#mknod -m 660 /tmp/null c 1 3
# ls -l /tmp/null
crw-rw----. 1 root root 1, 3 Sep 26 11:30 /tmp/null
Re: general question on null device
mknod -m 666 /db2/null c 1 3 will create an entry with world-writable permissions. If you want to, you can change its owner with chown db2user /db2/null
-
- Posts: 36
- Joined: 2017/03/14 10:01:39
Re: general question on null device
thanks to all. works fantastically.
except I was wrong in my thinking. I do not know if I am correct. please let me know.
I created this null device and it is working. how will I track the io happening on that null device?
iostat is not showing any information on the null device.
it shows only at LVM and disk partition level.
how will I track or make iostat or any other command to report saying this much bytes got written in this particular custom null device?
sorry for being such a botheration. this is my original requirement. iostat works at disk or partition or LVM level.
for a character device like null device how do I track that information.
thanks.
except I was wrong in my thinking. I do not know if I am correct. please let me know.
I created this null device and it is working. how will I track the io happening on that null device?
iostat is not showing any information on the null device.
it shows only at LVM and disk partition level.
how will I track or make iostat or any other command to report saying this much bytes got written in this particular custom null device?
sorry for being such a botheration. this is my original requirement. iostat works at disk or partition or LVM level.
for a character device like null device how do I track that information.
thanks.