Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

resize_ffs(8) [netbsd man page]

RESIZE_FFS(8)						    BSD System Manager's Manual 					     RESIZE_FFS(8)

NAME
resize_ffs -- resize a file system on disk or in a file SYNOPSIS
resize_ffs [-y] [-s size] special DESCRIPTION
resize_ffs resizes a file system. special is the name of the raw disk device or file where the file system resides. resize_ffs can both grow and shrink file systems. When growing, the disk device must of course be large enough to contain the new file system; resize_ffs simply extends the file system data structures into the new space. When shrinking, resize_ffs assumes this. resize_ffs has to copy anything that currently resides in the space being shrunk away; there must be enough space free on the file system for this to succeed. If there isn't, resize_ffs will complain and exit; when this happens, it attempts to always leave the file system in a consistent state, but it is probably a good idea to check the file system with fsck(8). If no -s option is provided, resize_ffs will grow the file system to the underlying device size which is determined from special. The options are as follows: -s Specify the file system size to which the file system should be resized. The size is given as the count of disk sectors, usually 512 bytes. It will not work correctly for file systems with other sector sizes. To see the exact value, have a look at the disk speci- fication or the disklabel. Mostly used to shrink file systems. -y Disable sanity questions made by resize_ffs. WARNING
Interrupting resize_ffs may leave your file system in an inconsistent state and require a restore from backup. It attempts to write in the proper order to avoid problems, but as it is still considered experimental, you should take great care when using it. When resize_ffs is applied to a consistent file system, it should always produce a consistent file system; if the file system is not consis- tent to start with, resize_ffs may misbehave, anything from dumping core to completely curdling the data. It's probably wise to fsck(8) the file system before and after, just to be safe. You should be aware that just because fsck(8) is happy with the file system does not mean it is intact. EXIT STATUS
resize_ffs exits with 0 on success. Any major problems will cause resize_ffs to exit with the non-zero exit(3) codes, so as to alert any invoking program or script that human intervention is required. EXAMPLES
resize_ffs /dev/vg00/rlv1 will enlarge the file system on the Logical Volume /dev/vg00/lv1 from Volume Group vg00 to the current device size. SEE ALSO
fs(5), fsck(8), newfs(8) HISTORY
The resize_ffs command first appeared in NetBSD 2.0. AUTHORS
der Mouse <mouse@rodents.montreal.qc.ca> (primary author) Jeff Rizzo <riz@NetBSD.org> (Byteswapped file system and UFS2 support) A big bug-finding kudos goes to John Kohl for finding the rotational layout bug referred to in the WARNING section above. BUGS
Can fail to shrink a file system when there actually is enough space, because it does not distinguish between a block allocated as a block and a block fully occupied by two or more frags. This is unlikely to occur in practice; except for pathological cases, it can happen only when the new size is extremely close to the minimum possible. Has no intelligence whatever when it comes to allocating blocks to copy data into when shrinking. Doesn't currently support shrinking FFSv2 file systems. BSD
January 4, 2011 BSD

Check Out this Related Man Page

extendfs(8)						      System Manager's Manual						       extendfs(8)

NAME
extendfs - Extends UFS file systems SYNOPSIS
/sbin/extendfs [- s] [disk_blocks] device_name DESCRIPTION
Use the extendfs command to increase the storage space in a UFS file system. The file system must not be mounted when you perform this operation. To extend a mounted (in use) UFS file system, use the mount command with the -o extend option. The procedure for increasing the storage space of a UFS file system is as follows: Look at the contents the /etc/fstab file to identify the disk partition that maps to the file system. Ensure that there is available storage space on the target disk as follows: If LSM is in use on your system, use LSM commands to increase the size of the LSM volume as described in the Logical Storage Manager guide. If LSM is not in use on your system, use the disklabel command or the diskconfig graphical user interface to check the current size and use of partitions on the disk. If there is adequate space on an adjacent partition, use the disklabel command to write the current label to a file as fol- lows: # disklabel -r dsk4 > d4label Edit the disklabel file to change the size of the partition on which your UFS file system resides. Increase the number of disk blocks on the partition and decrease the disk block size of the adjacent partition by an equivalent number. Use the disklabel command with the -R option to write the revised label to the raw disk as follows: # disklabel -R /dev/rdisk/dsk4 d4label When the disk label is revised, extend the file system using the extendfs command. You can either use the full extent of the newly sized partition or extend the file system in stages. The following example commands show both methods. To extend the file system to use all the available space, you specify the disk partition on which the file system resides, as follows: # extendfs /dev/disk/dsk4g To extend the file system to use only part of the available space, you specify a number of disk blocks, as follows: # extendfs -s 300000 /dev/disk/dsk4g The remainder of the extended partion is reserved for future use. You can extend a file system as many times as necessary, up to the physical limit of the storage device. When no more space is available on the storage device, you must back up the file system using the dump command and restore the file system to a storage device that has more available space. Once you have extended a file system, the operation cannot be reversed except by a back up and restore operation. Use the dump command to back up the file system. You can then reset the partition sizes manually and restore the file system to the storage device. ERRORS
The disklabel command produces output similar to that of the newfs command. If a list of disk blocks is not displayed on the terminal, the command has failed. Verify the partition settings and the mount status of the target file system. The disklabel command does not permit you to overwrite a partition if it is in use. Refer to the disklabel(8) reference page for more information on label errors. FILES
Specifies the command path. RELATED INFORMATION
diskconfig(8), disklabel(8), mount(8), and fstab(4). extendfs(8)
Man Page