How to destroy a zfs file system




















Documentation Home » Oracle Solaris Language: English. Become root. Destroy the ZFS file system. All rights reserved. ZFS dynamically stripes data among all of the top-level virtual devices in a pool. Virtual devices and the physical devices that are contained in a ZFS storage pool are displayed with the zpool status command.

Pool creation errors can occur for many reasons. Some reasons are obvious, such as when a specified device doesn't exist, while other reasons are more subtle. Before formatting a device, ZFS first determines if the disk is in-use by ZFS or some other part of the operating system.

If the disk is in use, you might see errors such as the following:. Some errors can be overridden by using the -f option, but most errors cannot.

The following conditions cannot be overridden by using the -f option, and you must manually correct them:. The disk or one of its slices contains a file system that is currently mounted. To correct this error, use the umount command. The disk is in use as the dedicated dump device for the system. To correct this error, use the dumpadm command. The disk or file is part of an active ZFS storage pool.

To correct this error, use the zpool destroy command to destroy the other pool, if it is no longer needed. Or, use the zpool detach command to detach the disk from the other pool. You can only detach a disk from a mirrored storage pool. The following in-use checks serve as helpful warnings and can be overridden by using the -f option to create the pool:. The disk is part of a storage pool that has been exported or manually removed from a system.

In the latter case, the pool is reported as potentially active , as the disk might or might not be a network-attached drive in use by another system. Be cautious when overriding a potentially active pool.

Creating pools with virtual devices of different replication levels is not recommended. The zpool command tries to prevent you from accidentally creating a pool with mismatched levels of redundancy. If you try to create a pool with such a configuration, you see errors similar to the following:. You can override these errors with the -f option, but you should avoid this practice. The command also warns you about creating a mirrored or RAID-Z pool using devices of different sizes.

Although this configuration is allowed, mismatched levels of redundancy result in unused disk space on the larger device. The -f option is required to override the warning. Attempts to create a pool can fail unexpectedly in different ways, and formatting disks is a potentially harmful action.

For these reasons, the zpool create command has an additional option, -n , which simulates creating the pool without actually writing to the device.

This dry run option performs the device in-use checking and replication-level validation, and reports any errors in the process. If no errors are found, you see output similar to the following:. Some errors cannot be detected without actually creating the pool. The most common example is specifying the same device twice in the same configuration. This error cannot be reliably detected without actually writing the data, so the zpool create -n command can report success and yet fail to create the pool when the command is run without this option.

This directory must either not exist or be empty. If the directory does not exist, it is automatically created. If the directory is empty, the root file system is mounted on top of the existing directory. To create a pool with a different default mount point, use the -m option of the zpool create command. Pools are destroyed by using the zpool destroy command. This command destroys the pool even if it contains mounted datasets. Caution - Be very careful when you destroy a pool.

Ensure that you are destroying the right pool and you always have copies of your data. If you accidentally destroy the wrong pool, you can attempt to recover the pool. These options can destroy large portions of the pool and consequently cause unexpected behavior for the mounted file systems that are in use. If the file system to be destroyed is busy and cannot be unmounted, the zfs destroy command fails.

To destroy an active file system, use the —f option. Use this option with caution as it can unmount, unshare, and destroy active file systems, causing unexpected application behavior. To destroy a ZFS file system, use the zfs destroy command. The destroyed file system is automatically unmounted and unshared. For more information about automatically managed mounts or automatically managed shares, see Automatic Mount Points.



0コメント

  • 1000 / 1000