From Wikipedia:
In Unix-like operating systems, /dev/null or the null device is a special file that discards all data written to it (but reports that the write operation succeeded), and provides no data to any process that reads from it (yielding EOF immediately). It may also be called the bit bucket or Black hole.
From www.rwc.uc.edu:In Unix-like operating systems, /dev/null or the null device is a special file that discards all data written to it (but reports that the write operation succeeded), and provides no data to any process that reads from it (yielding EOF immediately). It may also be called the bit bucket or Black hole.
A special file referred to as the null device or informally as the bit bucket. The most common use of this virtual device is to discard any data written (directed) to it. Additionally, it provides an End of File (EOF) when used as an input stream (read from).
The null device is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams. This is usually done by redirection.
In practice, /dev/null can be use as describe in the following examples;1. In conjunction with dd command, to locate the disk drive within JBOD farm.
By running dd command, we can locate the disk drive by physically scan it on JBOD . It indicated by disk led indicator which "steadily blinking". (led is steadily blinking because of excesive I/O activities generated by dd command)
root@sun1: # dd if=/dev/c2t3d0s2 of=/dev/nullBy running dd command, we can locate the disk drive by physically scan it on JBOD . It indicated by disk led indicator which "steadily blinking". (led is steadily blinking because of excesive I/O activities generated by dd command)
2. Use for netbackup performance test.
Besides as performance test, the scenario also good for filesystem integrity check. By writing into /dev/null, netbackup can perform whole filesystem backup with out occupied any real tape media. Once netbackup succeeded with whole filesystem backup, its indicated that the filesystem have good integrity.
Reference:
www.mass.dk (Enabling Netbackup to use /dev/null as storage unit)
Information is provided on a as-is basic. Use at own risk.
!! Creating the bpdm_dev_null file redirect ALL disk based backup to /dev/null on the media server where the touch is placed, not just the newly created one in the example below. Disable all production classes and delete the touch file when testing is complete. !!
a) touch /usr/openv/netbackup/bpdm_dev_null on a media server
b) Create a new disk storage unit (STU), using /tmp or some other directory as the image directory path
c) Create policy that points to the new disk stu.d) Run a backup using this policy.
NetBackup will create an image files as if it was a real backup image. The image file(s) will be zero bytes long.
e) To clean up the netbackup catalog use bpexpdate -d 0 -backupid {hostname_epoctime} (the backup id is part of the file name). This command remove the zero byte image file and delete the backup in the Netbackup catalog (it hard to restore anyway). Do not delete the file manual.
3. Most of cron jobs script sink the output to /dev/null, unless the owner expected emails for every cron jobs done.
Note:
In case for any reason /dev/null was missing, here is step to recover:
1. If only the soft link was missing:
root@sun1: # devlinks
2. In case the original device in /devices/... was missing:
root@sun1: mknod /devices/pseudo/mm@0:null c 13 2
root@sun1: chown root:sys /devices/pseudo/mm@0:null
root@sun1: chmod 666 /devices/pseudo/mm@0:null
root@sun1: cd /dev
root@sun1: ln -s ../devices/pseudo/mm@0:null null
Note:
In case for any reason /dev/null was missing, here is step to recover:
1. If only the soft link was missing:
root@sun1: # devlinks
2. In case the original device in /devices/... was missing:
root@sun1: mknod /devices/pseudo/mm@0:null c 13 2
root@sun1: chown root:sys /devices/pseudo/mm@0:null
root@sun1: chmod 666 /devices/pseudo/mm@0:null
root@sun1: cd /dev
root@sun1: ln -s ../devices/pseudo/mm@0:null null
** Do not bother sending complaints email. The mailbox have been set to /dev/null **
No comments:
Post a Comment