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. geoserver源码maven编译相关问题

    1.登陆失败跳转404错误 登陆失败后指向的路径为: http://192.168.15.97:8080/hgisserver/web/wicket/bookmarkable/org.geoserve ...

  2. scjp考试准备 - 10 - 类型转换

    题目为如下代码的执行结果: class Building{} public class Barn extends Building{ public static void main(String[] ...

  3. js中object的copy

    一.场景 在js中一个对象(Object)或者是一个数组(Array)在复制的过程中往往不是特别的简单,一般情况下我们会直接将其赋值给另外一个变量名下,就像这样: var a = [1,2,3]; v ...

  4. dotnet core项目升级到 .net core 2.0

    这几天无疑我们已经让.net core 2.0正式版发布的消息刷屏,这次发布整整提前了一个月的时间,关于具体的发布信息,可以去看善友大神的博客,.NET Core 2.0 正式发布信息汇总,废话不多说 ...

  5. android开发环境:使用Android Studio搭建Android集成开发环境(图文教程)

    开发环境情况: 物理机版本:Win 7旗舰版(64位) Java SDK版本:jdk1.8.0_25(64位) Android SDK版本:Android 7.1(API 25) Android St ...

  6. js图片倒计时

    var discountOnline = !{discountOnline} if (discountOnline) { _fresh() setInterval(_fresh, 1000); } v ...

  7. 《The Cg Tutorial》阅读笔记——环境贴图 Environment Mapping

    本文为大便一箩筐的原创内容,转载请注明出处,谢谢:http://www.cnblogs.com/dbylk/p/4969956.html 环境贴图 Environment Mapping 一.简介 环 ...

  8. 【51nod-1183】编辑距离

    链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1183 #include <bits/stdc++.h> ...

  9. Activity的基本概念与Activity的生命周期

    一.Activity的基本概念 Activity是Android的四大组件之一,它是一种可以包含用户界面的组件,主要用于和用户进行交互,比如打电话,照相,发送邮件,或者显示一个地图!Activity用 ...

  10. java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xiaozao_web]]

    二月 20, 2017 11:30:28 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRul ...