6.24 Init Device

init <device_name> [format] [shared|unshared]

Initialize a device by deleting all partitions on the device and setting the partitioning scheme.

nlvm [nlvm_options] init <device_name> [format] [shared|unshared]

You are automatically prompted to confirm the initialize action. Respond by typing yes or no, then press Enter. Use the --no-prompt NLVM option to suppress the confirmation prompt.

You can optionally specify whether to set the device as shared or unshared. If neither the shared nor unshared option is added, the device is initialized, the partitioning scheme is set, and the shared state remains what it was before the initialize command.

Command Options

device_name

Mandatory. Specify the name of the device to be initialized. This must be the first command option.

You can enter multiple devices by separating the device names with a comma and no spaces.

Examples

sdb
sde,sdf,sdg
format=<gpt|msdos>

Specify the partitioning scheme as gpt or msdos. The default is msdos. The MSDOS partitioning scheme supports device sizes that are less than or equal to 2 TB. If the device size is greater than 2 TB and the partitioning scheme is not specified, the default partitioning scheme of MSDOS applies, and the device size is truncated to 2 TB with the remainder as unusable space. Devices of any size can be set to use the GPT partitioning scheme.

Example

format=msdos
shared

After initializing the device, the device is set as shared. A small partition is created on the device to store the shared setting. The remainder of the device is free space.

For example, use this option to mark a device as Shareable for Clustering if you plan to use it for a shared NSS pool. NSS looks for this setting to cluster enable the pool.

unshared

After initializing the device, the device is not marked as shared. The device is unpartitioned free space.

Use this option to remove all partitions from a device. For example, LVM requires that a device contains no partitions before it creates a volume group on it.

-f , --force

Optional. Specify this NLVM option to force the initialization. This option is required if the device contains a root (/), swap, or boot partition, or if the init command cannot delete any pools on the disk.

Examples

-f
--force
--no-prompt

Optional. Specify this NLVM option to prevent a confirmation message from being displayed.

Example

--no-prompt

Command Examples

nlvm --force init sdb

Force the initialization of a previously formatted device /dev/sdb, and set its partitioning scheme to use the default setting of msdos. If the device size is greater than 2TB, the device has only 2 TB of usable space. If the device was previously set as shared, the shared setting remains after the initialization. Otherwise, the device is unshared.

nlvm init sdd format=gpt unshared

Initialize the device /dev/sdd, and set its partitioning scheme to GPT. If the device was previously set as shared, this removes the shared setting from the device. The device is unpartitioned free space.

nlvm init sde format=gpt shared

Initialize the device /dev/sde, set its partitioning scheme to GPT, and mark the device as shared. The device contains a small partition to hold the shared setting, and the rest is free space.

nlvm --no-prompt init sde,sdf,sdg format=gpt unshared

Initialize multiple devices at a time. Set each device’s partitioning scheme to GPT. If a device was previously set as shared, the unshared option removes its shared setting. The devices are each unpartitioned free space. The confirmation message is not displayed.