In AIX, there is rmdev command to remove a disk/LUN from /dev directory i.e to make the disk/LUN unavailable to the whole OS before physically removing it.
 
But in Linux, there's no specific command to the same. Here's how you will actually do it:
 
 
Make sure that the disk is not being used by the application, does not contain a mounted file system or an active volume group.
 
1. Take the disk offline:
 
cd /sys/block/sdb/device
echo “offline” >state
 
2. Delete from /dev
 
echo 1 >delete
 
You can make your own script with the name rmdev ;)
 
#!/bin/ksh
 
dev=$1
 
[[ ! -d "$dev" ]] && echo "$dev does not exist" && exit 1
 
echo "offline" >/sys/block/"$dev"/device/state
echo 1 >/sys/block/"$dev"/device/delete

Linux: How to delete a disk or LUN reference from /dev的更多相关文章

  1. SQL SERVER 2005删除维护作业报错:The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_id"

    案例环境: 数据库版本: Microsoft SQL Server 2005 (Microsoft SQL Server 2005 - 9.00.5000.00 (X64) ) 案例介绍: 对一个数据 ...

  2. [Linux] Extend space of root disk in Linux7

    [root@node1 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/centos-root 26G 17G 9.8G ...

  3. linux操作系统清除报错Disk /dev/mapper/ddf1_4c53492....

    现象描述 Disk /dev/mapper/ddf1_4c5349202020202010000055000000004711471100000a28p1: 666.0 GB, 66600088934 ...

  4. The DELETE statement conflicted with the REFERENCE constraint

    Page是主表,主键是pageid:UserGroupPage表中的PageID字段是Page表里的数据. https://www.codeproject.com/Questions/677277/I ...

  5. Azure上批量创建OS Disk大于30G的Linux VM

    Azure上VM的OS盘的大小在创建时是固定的.Windows是127G,Linux是30G.如果需要批量创建的VM的OS Disk有更大的容量.可以考虑用下面的方法实现. 1 创建一台有Data-d ...

  6. 12 Useful “df” Commands to Check Disk Space in Linux

    On the internet you will find plenty of tools for checking disk space utilization in Linux. However, ...

  7. Linux 集群

    html,body { } .CodeMirror { height: auto } .CodeMirror-scroll { } .CodeMirror-lines { padding: 4px 0 ...

  8. Linux 相关scsi命令

    Linux 相关scsi命令 由于前段时间存储扩容,对存储操作较多,下面记录了常用的操作: lsscsi命令:显示scsi设备信息 #lsscsi [0:0:0:2]    disk    IBM   ...

  9. Linux中三种SCSI target的介绍之LIO

    版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/scaleqiao/article/deta ...

随机推荐

  1. Codeforces 9C Hexadecimal's Numbers - 有技巧的枚举

    2017-08-01 21:35:53 writer:pprp 集训第一天:作为第一道题来讲,说了两种算法, 第一种是跟二进制数联系起来进行分析: 第二种是用深度搜索来做,虽然接触过深度搜索但是这种题 ...

  2. Minimum Path Sum,最短路径问题,动态规划

    问题描述:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right ...

  3. RabbitMQ初体验

    这里官方使用的Pom是4.0.2版本 <dependencies> <dependency> <groupId>com.rabbitmq</groupId&g ...

  4. root run-parts

    crontab的文件格式 分 时 日 月 星期 要运行的命令 第1列分钟0-59 第2列小时0-23(0表示子夜) 第3列日1-31 第4列月1-12 第5列星期0-7(0和7表示星期天) 第6列要运 ...

  5. Python连接MongoDB操作

    1.安装PyMongo 注意:请勿安装“bson”软件包. PyMongo配有自己的bson包; 执行“pip install bson”或“easy_install bson”则会安装与PyMong ...

  6. PL/SQL通过修改配置文件的方式实现数据库的连接

    http://jingyan.baidu.com/article/c74d600080632a0f6a595d80.html

  7. HYSBZ - 2818莫比乌斯反演

    链接 题意很简洁不说了 题解:一开始我想直接暴力,复杂度是O(log(1e7)*sqrt(1e7))算出来是2e9,可能会复杂度爆炸,但是我看时限是10s,直接大力莽了一发暴力,没想到就过了= = 就 ...

  8. MYSQL(python)安装记录

    捯饬了很长时间,终于安装成功了,特此记录下! MYSQL历史版本下载,一般为绿色版本 地址:http://downloads.mysql.com/archives/community/ MYSQL安装 ...

  9. 如何退出telnet

    ctrl键+ENter键 然后输入 进入telnet 命令 quit

  10. Myeclipse快捷键的设置以及默认的编码格式

    设置默认的编码格式