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
HFORMAT(1)						      General Commands Manual							HFORMAT(1)

NAME
hformat - create a new HFS filesystem and make it current SYNOPSIS
hformat [-f] [-l label] destination-path [partition-no] DESCRIPTION
hformat is used to write a new HFS filesystem to a volume. A UNIX pathname to the volume's destination must be specified. The destination may be either a block device or a regular file, but it must already exist and be writable. An optional label can be specified to name the volume. The name must be between 1-27 characters and cannot contain a colon (:). By default, the volume will be named Untitled. If the destination medium is partitioned, one partition must be selected to receive the filesystem. If there is only one HFS partition on the medium, it will be selected by default. Otherwise, the desired partition number must be specified (as the ordinal nth HFS partition) on the command-line. The size of the partition determines the size of the resulting volume. Partition number 0 can be specified to format the entire medium as a single filesystem without a partition map, erasing any existing parti- tion information. Since this will destroy all the partitions, the -f option must be specified to force this operation if the medium cur- rently contains a partition map. If the medium is not partitioned (or if partition 0 is specified), the size or capacity of the medium determines the size of the resulting volume. The new volume will be empty and will become "current" so subsequent commands will refer to it. The current working directory for the vol- ume is set to the root of the volume. EXAMPLES
% hformat /dev/fd0 If a floppy disk is available as /dev/fd0, this formats the disk as an HFS volume named Untitled. (N.B. The floppy must already have received a low-level format by other means.) % dd if=/dev/zero of=disk.hfs bs=1k count=800 % hformat -l "Test Disk" disk.hfs This sequence creates an 800K HFS volume image in the file disk.hfs in the current directory, and names it Test Disk. % hformat -l "Loma Prieta" /dev/sd2 1 If a SCSI disk is available as /dev/sd2, this initializes the first HFS partition on the disk (which must already exist) with a new filesystem, naming the resulting volume Loma Prieta. % hformat -f /dev/sd2 0 This causes the medium accessible as /dev/sd2 to be reformatted as a single HFS volume, ignoring and erasing any existing partition information on the medium. The -f option must be specified if the medium is currently partitioned; otherwise the command will fail. NOTES
This command does not create or alter partition maps, although it can erase them (as described above). Any partition number specified on the command line must already exist. The smallest volume size which can be formatted with hformat is 800K. SEE ALSO
hfsutils(1), hmount(1) FILES
$HOME/.hcwd AUTHOR
Robert Leslie <rob@mars.org> HFSUTILS
08-Nov-1997 HFORMAT(1)
All times are GMT -4. The time now is 05:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy