disk remove

Removes a disk from MapR Filesystem. Permissions required: fc or a.

The disk remove command does not remove a disk containing unreplicated data, unless forced. To force disk removal, specify -force with the value 1 or true.

Note:
  • Use the -force 1, or the equivalent -force true option only if you are sure that you do not need the data on the disk. This option removes the disk without regard to the replication factor or other data protection mechanisms, and may result in permanent data loss.
  • Removing a disk in the storage pool that contains Container ID 1 stops the cluster. Container ID 1 contains CLDB data for the master CLDB. Run disk remove without the -force 1, or the equivalent -force true option first, and examine the warning messages to make sure that you are not removing the disk with Container ID 1. If you try to remove a disk associated with the storage pool that contains Container ID 1, you receive an error message similar to the following:
    ERROR (151) -  Failed operation for disk /dev/sdb, Operation may bring 
    down cluster due to loss of cluster meta-data.
    Tip: If necessary, run the following command for information on the disk associated with the storage pool that contains Container ID 1:
    /opt/mapr/server/mrconfig info dumpcontainers  | grep cid:1
    The command output may look similar to the following:
    cid:1 volid:1 sp:SP1:/dev/sdb spid:82380c287085486f0058112ecf016b76 
    prev:0 next:0 issnap:0 isclone:0 deleteinprog:0 fixedbyfsck:0 stale:0 
    querycldb:0 resyncinprog:0 shared:0 owned:206 logical:206 snapusage:0 
    snapusageupdated:1 ismirror:0 isrwmirrorcapable:0 role:1 maxUniq:2100150 
    isResyncSnapshot:0 snapId:0 port:5660
    To safely remove such a disk, first perform a CLDB Failover to make one of the other CLDB nodes the primary CLDB, and then remove the disk as normal.

Syntax

CLI
/opt/mapr/bin/maprcli disk remove
    -host name/ip 
    -disks comma-separated list of disks 
    [ -force <true|false OR 1|0>. Need this parameter to actually remove the disk, otherwise this command behaves like a test remove. default: false ]
    [ -cluster cluster_name ] 
REST
Request Type POST
Request URL
http[s]://<host>:<port>/rest/disk/remove?<parameters> 

Parameters

Parameter Description
host The hostname or ip address of the node from which to remove the disk.
disks A list of disks in the form:
["disk"]or["disk","disk","disk"...]or[]
force Whether to force disk removal.
  • 0 or false (default) - do not remove the disk or disks if there is unreplicated data on the disk
  • 1 or true - remove the disk or disks regardless of data loss, or other consequences
cluster The cluster on which to run the command.

Output

Output Fields

Field

Description

disk

The name of a disk or partition. Example: sca or sca/sca1

all

The string all, meaning all unmounted disks attached to the node.

disks

A comma-separated list of disks which have non-replicated volumes. For example, "sca" or "sca/sca1,scb"

Examples

Remove a disk:

/opt/mapr/bin/maprcli disk remove -disks /dev/sda
https://abc.sj.us:8443/rest/disk/remove?disks=/dev/sda