Sponsored Content
Full Discussion: Defragmenting
Top Forums UNIX for Dummies Questions & Answers Defragmenting Post 725 by Neo on Wednesday 10th of January 2001 12:18:20 PM
Old 01-10-2001
When one partition is getting full and there are few options to reduce the size, the normal fix is to move directory trees to new partitions and then create a symbolic link from the new directory node to the old one.

For example, lets say that your /user directory is big because you have a lot of users and /user is in the root partition. You would copy the entire /user directory using either a recursive copy (or TAR) to another partition, for example /usr1. Depending on the actual file system, you could just move the old one (just to be safe) i.e. move /user to /user.old Then you would link /usr1/user to /user using a command like:

Code:
ln -sf /usr1/user /user

After you test it and it works OK (always test!) then you can delete/remove the original files. You can't do this if you have active processes from the filesystem (you will get a filesystem busy error) or if your shell is in the directory, BTW. Also, moving dynamic libaries and other core libaries can be done, but requires experience. Suggest you relocate user and temporary files first. It takes a lot of courage to move and relocate system binaries and libs, because one false step can result in a filesystem which must be rebuilt from a boot disk.

[Edited by Neo on 01-10-2001 at 01:06 PM]
 

We Also Found This Discussion For You

1. Linux

defragmenting

Can i defragment a windows FAT32 vol in linux iF so Then how do i do that also How do i mount a nfts partition in read write mode need help (5 Replies)
Discussion started by: wojtyla
5 Replies
GETPEEREID(3)						   BSD Library Functions Manual 					     GETPEEREID(3)

NAME
getpeereid -- get the effective credentials of a UNIX-domain peer LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <unistd.h> int getpeereid(int s, uid_t *euid, gid_t *egid); DESCRIPTION
The getpeereid() function returns the effective user and group IDs of the peer connected to a UNIX-domain socket. The argument s must be a UNIX-domain socket (unix(4)) of type SOCK_STREAM on which either connect(2) or listen(2) have been called. The effective used ID is placed in euid, and the effective group ID in egid. The credentials returned to the listen(2) caller are those of its peer at the time it called connect(2); the credentials returned to the connect(2) caller are those of its peer at the time it called listen(2). This mechanism is reliable; there is no way for either side to influence the credentials returned to its peer except by calling the appropriate system call (i.e., either connect(2) or listen(2)) under different effective credentials. One common use of this routine is for a UNIX-domain server to verify the credentials of its client. Likewise, the client can verify the cre- dentials of the server. IMPLEMENTATION NOTES
On FreeBSD, getpeereid() is implemented in terms of the LOCAL_PEERCRED unix(4) socket option. RETURN VALUES
The getpeereid() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indi- cate the error. ERRORS
The getpeereid() function fails if: [EBADF] The argument s is not a valid descriptor. [ENOTSOCK] The argument s is a file, not a socket. [ENOTCONN] The argument s does not refer to a socket on which connect(2) or listen(2) have been called. [EINVAL] The argument s does not refer to a socket of type SOCK_STREAM, or the kernel returned invalid data. SEE ALSO
connect(2), getpeername(2), getsockname(2), getsockopt(2), listen(2), unix(4) HISTORY
The getpeereid() function appeared in FreeBSD 4.6. BSD
July 15, 2001 BSD
All times are GMT -4. The time now is 08:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy