08-28-2012
The problem i have is one of the directory contains all my project critical data and is also mounted as filesystem.The second directory i suspect is created via netbackup restore (I am not sure how) is occupying space under root filesytem and making it full.I want to get rid of second directory which is making root full.But when i change directory i am not sure which directory i am in cause is see same contents
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a TAR (compressed) file that I uncompressed using the following command
$ tar xvf uagent.tar
It created a directory structure as follows
<root>/arcagent/UAGENT/reloc/$UAGENT_HOME/
How do I access files under the $UAGENT_HOME? Every time I do change directory command, the OS... (3 Replies)
Discussion started by: pkappaz
3 Replies
2. Shell Programming and Scripting
The script below was written to select files and convert a particular string to something other and replace that file. However, I came across some issues with filenames that contain spaces, any suggestions to get around this? Any other suggestions that may apply to this code would also be... (5 Replies)
Discussion started by: Shakey21
5 Replies
3. UNIX for Dummies Questions & Answers
Hi, I know that inode for each file is unique, but is it the for the directory? So far I found different directories has the same inode nubmer when you do ls -i, could some one explain why? Thanks a lot. (9 Replies)
Discussion started by: nj302
9 Replies
4. Shell Programming and Scripting
I need help writing a bash script for the windows cygwin environment. I'm not sure if bash is the optimal tool. Perhaps perl would be better? Either would work.
I have directories whose names include the date they were created. The directory names are in the format of... (0 Replies)
Discussion started by: siegfried
0 Replies
5. Shell Programming and Scripting
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies
6. UNIX for Dummies Questions & Answers
hai,
I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc".
(here "oasitqtc" is the owner of the directory or sub directory.)
i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Discussion started by: gagan4599
6 Replies
7. UNIX for Dummies Questions & Answers
I am trying to loop through folders and extract the name of the lowest level subfolder
I was running the script below, it returns
/bb/bin/prd/newyork
/bb/bin/prd/london
/bb/bin/prd/tokyo
I really want
newyork
london
tokyo
I couldn't find a standard variable for the lowest level... (1 Reply)
Discussion started by: personalt
1 Replies
8. Shell Programming and Scripting
got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies
9. Shell Programming and Scripting
Hi guys,
I have lots of files that look like:
ABC.packed.dir
DEF.packed.dir
GHI.packed.dir
etc...
I would like them to have more of the usual naming convention
ABC
DEF
GHI
etc...
so I was thinking that I could: (2 Replies)
Discussion started by: atjurhs
2 Replies
10. UNIX for Dummies Questions & Answers
Some guidance is highly appreciated.
I have 10 directories with names ending with 'xyz', each of them have about 30000 files. I want to loop through the contents of each directory and produce a single output per directory. So I want to have 10 output files named 'directory_name'_out.
With... (1 Reply)
Discussion started by: newbie83
1 Replies
LEARN ABOUT LINUX
pivot_root
PIVOT_ROOT(2) Linux Programmer's Manual PIVOT_ROOT(2)
NAME
pivot_root - change the root file system
SYNOPSIS
int pivot_root(const char *new_root, const char *put_old);
DESCRIPTION
pivot_root() moves the root file system of the calling process to the directory put_old and makes new_root the new root file system of the
calling process.
The typical use of pivot_root() is during system startup, when the system mounts a temporary root file system (e.g., an initrd), then
mounts the real root file system, and eventually turns the latter into the current root of all relevant processes or threads.
pivot_root() may or may not change the current root and the current working directory of any processes or threads which use the old root
directory. The caller of pivot_root() must ensure that processes with root or current working directory at the old root operate correctly
in either case. An easy way to ensure this is to change their root and current working directory to new_root before invoking pivot_root().
The paragraph above is intentionally vague because the implementation of pivot_root() may change in the future. At the time of writing,
pivot_root() changes root and current working directory of each process or thread to new_root if they point to the old root directory.
This is necessary in order to prevent kernel threads from keeping the old root directory busy with their root and current working direc-
tory, even if they never access the file system in any way. In the future, there may be a mechanism for kernel threads to explicitly
relinquish any access to the file system, such that this fairly intrusive mechanism can be removed from pivot_root().
Note that this also applies to the calling process: pivot_root() may or may not affect its current working directory. It is therefore rec-
ommended to call chdir("/") immediately after pivot_root().
The following restrictions apply to new_root and put_old:
- They must be directories.
- new_root and put_old must not be on the same file system as the current root.
- put_old must be underneath new_root, that is, adding a nonzero number of /.. to the string pointed to by put_old must yield the same
directory as new_root.
- No other file system may be mounted on put_old.
See also pivot_root(8) for additional usage examples.
If the current root is not a mount point (e.g., after chroot(2) or pivot_root(), see also below), not the old root directory, but the mount
point of that file system is mounted on put_old.
new_root does not have to be a mount point. In this case, /proc/mounts will show the mount point of the file system containing new_root as
root (/).
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
pivot_root() may return (in errno) any of the errors returned by stat(2). Additionally, it may return:
EBUSY new_root or put_old are on the current root file system, or a file system is already mounted on put_old.
EINVAL put_old is not underneath new_root.
ENOTDIR
new_root or put_old is not a directory.
EPERM The calling process does not have the CAP_SYS_ADMIN capability.
VERSIONS
pivot_root() was introduced in Linux 2.3.41.
CONFORMING TO
pivot_root() is Linux-specific and hence is not portable.
NOTES
Glibc does not provide a wrapper for this system call; call it using syscall(2).
BUGS
pivot_root() should not have to change root and current working directory of all other processes in the system.
Some of the more obscure uses of pivot_root() may quickly lead to insanity.
SEE ALSO
chdir(2), chroot(2), stat(2), initrd(4), pivot_root(8)
COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2007-06-01 PIVOT_ROOT(2)