Here’s some example output:
root# du -hS --inodes / |sort -h
..cut
703 /var/log
1.1K /usr/bin
1.3K /usr/share/man/man1
2.0K /usr/share/man/man3
2.7K /var/lib/dpkg/info
Just another site
Here’s some example output:
root# du -hS --inodes / |sort -h
..cut
703 /var/log
1.1K /usr/bin
1.3K /usr/share/man/man1
2.0K /usr/share/man/man3
2.7K /var/lib/dpkg/info
While deleting files/folders on the NSS volume on an OES11 server as root user via shell. Let’s say test1.doc and the following error will occur:
“rm: cannot remove `test1.doc’: Permission denied” or “S-1-1-0-1 on a Windows machine.”
You will get that error if you have flagged the file with NSS flag “Delete Inhibit” or “Rename Inhibit”. Clear those flags out and it should also be possible to delete the file directly from a Linux console. Use this command:
root# attrib -r -c all foldername
Let say that you have OES11 machine with NSS volume and you would like to export this volume to Linux machine for sharing data.
To exporting and NSS Volume from an OES11 machine to a Linux machine, add the following to /etc/export on OES11 machine:
root# cat /etc/export
/media/nss/DATA/Shared/XXHR/BNMDEV1 Linux(fsid=1,rw,no_root_squash,sync,anonuid=1000,all_squash)
root#
To mount NSS volume from an OES11 machine into a Linux machine, add the following to /etc/fstab on Linux machine:
root# cat /etc/fstab
oes11:/media/nss/DATA/Shared/XXHR/BNMDEV1 /share/Shared/XXHR/BNMDEV1 nfs defaults 0 0
root#
to verity that everything is okay type mount command on a Linux machine, and you should see something like this:
root# mount
OES11:/media/nss/DATA/Shared/XXHR/BNMDEV1 on /share/Shared/XXHR/BNMDEV1 type nfs (rw,addr=172.16.12.12)
Just run this script 🙂
find HR Operations| while read NAME; do stats=`stat --format "%n;%y;%s;%U" "$NAME"`; rightss=`rights -f "$NAME" show|grep -i "CN="|tr 'n' ' '`; echo "$stats;$rightss"; done > "HR_Operations.csv"
The filename and pathname lengths are limited; constants defined in linux/limits.h
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4096 /* # chars in a path name including nul */
nbfs1:~ # getconf NAME_MAX /
255
nbfs1:~ # getconf PATH_MAX /
4096
nbfs1:~ #
While deleting files/folders on the NSS volume on an OES11 server as root user via shell. Let’s say test1.doc and the following error will occur:
“rm: cannot remove `test1.doc’: Permission denied” or “S-1-1-0-1 on a Windows machine.”
You will get that error if you have flagged the file with NSS flag “Delete Inhibit” or “Rename Inhibit”. Clear those flags out and it should also be possible to delete the file directly from a Linux console.
Use this command:
root# attrib -r -c all foldername
A common programming technique is to create a temporary file and immediately unlink() it. This leaves the file (and its space) available for the duration of the program but automatically causes its removal when the program using it terminates. One advantage is that no epilog (cleanup) code is necessary to write. To determine if you have a process holding an unlinked file open, do:
lsof -a +L1 /ebstest01db
or
lsof +D /ebstest01db +L1
Look for any files with an NLINK value of zero (0). These would be files with a zero link count that will vanish when the last process terminates. The SIZE/OFFSET column will offer the character size of the file in question.
sles02:/ # lsof -a +L1 /ebstest01db
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
oracle 9605 ebstest01 256u REG 8,33 40255488 0 3678213 /oradata/data_old/cntrl01.dbf (deleted)
oracle 9605 ebstest01 257u REG 8,33 40255488 0 5775361 /oradata/data_old/cntrl02.dbf (deleted)
oracle 9605 ebstest01 258u REG 8,33 40255488 0 9969665 /oradata/data_old/cntrl03.dbf (deleted)
oracle 9605 ebstest01 259uW REG 8,33 4294975488 0 2629640 /oradata/data_old/system01.dbf (deleted)
oracle 9605 ebstest01 260uW REG 8,33 4294975488 0 3678209 /oradata/data_old/system02.dbf (deleted)
oracle 9605 ebstest01 261uW REG 8,33 4294975488 0 3678210 /oradata/data_old/system03.dbf (deleted)
oracle 9605 ebstest01 262uW REG 8,33 4294975488 0 1597441 /oradata/data_old/system04.dbf (deleted)
oracle 9605 ebstest01 263uW REG 8,33 4294975488 0 1597448 /oradata/data_old/system05.dbf (deleted)
oracle 9605 ebstest01 264uW REG 8,33 4294975488 0 1597449 /oradata/data_old/system06.dbf (deleted)
oracle 9605 ebstest01 265uW REG 8,33 4294975488 0 1597450 /oradata/data_old/system07.dbf (deleted)
oracle 9605 ebstest01 266uW REG 8,33 4294975488 0 1597451 /oradata/data_old/system08.dbf (deleted)
oracle 9605 ebstest01 267uW REG 8,33 4632879104 0 4931624 /oradata/data_old/sysaux01.dbf (deleted)
oracle 9605 ebstest01 268uW REG 8,33 4554235904 0 4931599 /oradata/data_old/sysaux02.dbf (deleted)
And now kill the 3605 process.
Disk Quotas is the most natural starting point in building a solid storage strategy. Setting quotas will easily let you:
– Show users what reasonable storage use is – define an upper limit.
– Allow storage to grow in a controlled and sustainable manner.
– Promote efficient usage and streamline backup/restore times.
This script will set a quota directory on the Novell Storage Services for Novell Open Enterprise Server 11.
Continue reading “Set a directory quota on an OES11 – NSS volume using a command line.”
To issue a SCSI bus rescan you must know on which bus you’ve added the device. If you don’t know which bus and if there are mutliple buses on the system you can rescan each bus which will be somehow annoying but will not interrupt the system.
To initiate a SCSI bus rescan type:
root# echo "- - -" > /sys/class/scsi_host/hostX/scan
where X stands for the SCSI bus you want to scan, and then you can type the following:
root# lsscsi
root# fdisk -l
root# tail -f /var/log/message
Also C T L “Channel on HBA” “Tatget SCSI id” “LUN” can be used instead of “—“.
To enable the local Linux user to access the NSS resource exported via NFS, we need to create a user in eDirecotry and then enable this user in LUM in this example the user has an UID 1000, and then we can export the NSS via NFS to another server with user’s rights:
cat /etc/exsports
/media/nss/somedata/somedata server(fsid=1,rw,no_root_squash,sync,anonuid=1000,all_squash)