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. Python基础笔记系列五:元组

    本系列教程供个人学习笔记使用,如果您要浏览可能需要其它编程语言基础(如C语言),why?因为我写得烂啊,只有我自己看得懂!! 元组 1)元组的结构和访问.使用方法和列表基本一致,区别主要有两点:1.使 ...

  2. hdu 2126 Buy the souvenirs 二维01背包方案总数

    Buy the souvenirs Time Limit: 10000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  3. 使用 <!-- 指定使用hibernate核心配置文件 --> <property name="configLocations" value="classpath:hibernate.cfg.xml"></property>

    在bean.xml文件中,这样使用出现问题 <!-- 指定使用hibernate核心配置文件 --> <property name="configLocations&quo ...

  4. spring mvc : 中文传值(post/get)中文乱码

    请将以下代码放入 web.xml文件中,注意存放顺序,否则会报错.filter应该放在context-param后面: <!-- 字符过滤器 --> <filter> < ...

  5. oracle: 分割字符串,或者查找字段里面的关键字(关键字1,关键字2,关键字3)

    表中有一个字段:keyword, keyword里面的存储的字符一般是:[关键字1,关键字2,关键字3] 那么,在搜索的时候,不能用like 来模糊查询,因为这样会,多查询出一下不相干的关键字, hi ...

  6. linux语言设置i18n(转)

    修改 /etc/sysconfig/i18n 文件,如 LANG="en_US.UTF-8",xwindow会显示英文界面, LANG="zh_CN.GB18030&qu ...

  7. react: next-redux-saga

    instead of using the Provider component, you can use the withRedux higher order component to inject ...

  8. 前端画图之iphoneSE主屏

    今天逛园子,无意间看到一个用div+css画的Macbook Air的博客,瞬间想到很久之前我也做过类似的事, 而且,当时写完之后,真的是成就感爆棚啊!我去开源中国上翻到了我当时贴的源码,当时是在手机 ...

  9. css选择器的特殊性值

    今天从前端那拿来写好的页面,就开始动工,首先,照旧处理导航栏高亮的问题, 说到处理高亮的问题,不同的人会有不同的方法,比如: //类名为nav的元素下的第n个a元素 .nav a:nth-of-typ ...

  10. Spring Boot打包总结

    环境配置信息 -** JDK 1.8 -** Spring Boot 1.5.3.RELEASE -** IDE: STS 3.4 Spring Boot下打包过程 基于STS创建Spring boo ...