SlideShare a Scribd company logo
pg. 1 by chanakan@cclk.lk
ASK BY LINUX KERNEL ADD OR DELETE A HDD
TO DELETE:
The HDD need to be deactivated Temporally,
echo 1 > /sys/block/sdc/device/delete
echo 1 > /sys/block/sde/device/delete
To verify,
pvs -a -o +dev_size
Or the HDD need to be deactivated Permanently,
before suspend.
To make it permanent, add the following file in /etc/pm/sleep.d/ ,
-rwxr-xr-x 1 root root 204 Dec 6 16:03 99_delete_sdc
-rwxr-xr-x 1 root root 204 Dec 6 16:03 99_delete_sde
With Content:
#!/bin/sh
# Delete the failing disk so that it will not block suspend
case "$1" in
suspend|hibernate)
if [ -d /sys/block/sdc ]; then
echo 1 > /sys/block/sdc/device/delete
fi
if [ -d /sys/block/sde ]; then
echo 1 > /sys/block/sde/device/delete
fi
;;
esac
TO ADD IT BACK:
Issue the following to add it back,
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
init 6
cd /sys/block ; ls && pvs -a -o +dev_size

More Related Content

TXT
How to install
PPTX
Defragmentation
ODP
Os Bernier
PDF
Reverse Engineering the "Human API" for Automation and Profit
PDF
Linux fundamental - Chap 10 fs
PPTX
Configurar o Meu Computador
PPTX
Nvvp streams-2
PDF
Clase4 (consola linux)
How to install
Defragmentation
Os Bernier
Reverse Engineering the "Human API" for Automation and Profit
Linux fundamental - Chap 10 fs
Configurar o Meu Computador
Nvvp streams-2
Clase4 (consola linux)

What's hot (19)

TXT
PDF
Iscsi
DOC
Disk suit 4 setup and installation
DOCX
BOOTABLE OPERATING SYSTEM
PDF
Chap 17 advfs
PPTX
System administration
PDF
3 how to-backup_and_recovery
PDF
Linux fundamental - Chap 03 file
TXT
Emu log
PDF
ubunturef
PDF
Linux fundamental - Chap 12 Hardware Management
PDF
Scaling IO-bound microservices
DOCX
Comp 129 final exam 100% correct answers
PPTX
Hadoop installation
PPT
Running hadoop on ubuntu linux
DOCX
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
PDF
Hadoop 3.1.1 single node
PDF
System administration
Iscsi
Disk suit 4 setup and installation
BOOTABLE OPERATING SYSTEM
Chap 17 advfs
System administration
3 how to-backup_and_recovery
Linux fundamental - Chap 03 file
Emu log
ubunturef
Linux fundamental - Chap 12 Hardware Management
Scaling IO-bound microservices
Comp 129 final exam 100% correct answers
Hadoop installation
Running hadoop on ubuntu linux
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 3.1.1 single node
System administration
Ad

Similar to Ask by linux kernel add or delete a hdd (20)

PDF
Improve your storage with bcachefs
PDF
openbsd-as-nas.pdf
PDF
Recipe of a linux Live CD (archived)
PPTX
First Responder Course - Session 10 - Static Evidence Collection [2004]
PDF
Jackpot! Attacking Arcade Machines
PPT
Ch12 system administration
PDF
Adrian Mouat - Docker Tips and Tricks
PPT
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
DOCX
Linux lv ms step by step
TXT
Forcefully unmount a linux disk partition
PPT
PDF
Mirroring the root_disk under solaris SVM
PPSX
Linux configer
PDF
PPTX
10 ways to improve your rman script
PPTX
Android unlocking and rooting
PDF
ZFS Talk Part 1
PDF
Cd rom how solaris manages cd-rom and diskette devices
PDF
Xen time machine
PDF
Clase10 (consola linux)
Improve your storage with bcachefs
openbsd-as-nas.pdf
Recipe of a linux Live CD (archived)
First Responder Course - Session 10 - Static Evidence Collection [2004]
Jackpot! Attacking Arcade Machines
Ch12 system administration
Adrian Mouat - Docker Tips and Tricks
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Linux lv ms step by step
Forcefully unmount a linux disk partition
Mirroring the root_disk under solaris SVM
Linux configer
10 ways to improve your rman script
Android unlocking and rooting
ZFS Talk Part 1
Cd rom how solaris manages cd-rom and diskette devices
Xen time machine
Clase10 (consola linux)
Ad

More from Chanaka Lasantha (20)

PDF
Storing, Managing, and Deploying Docker Container Images with Amazon ECR
PDF
Building A Kubernetes App With Amazon EKS
PDF
ERP System Implementation Kubernetes Cluster with Sticky Sessions
PDF
Free radius for wpa2 enterprise with active directory integration
PDF
Distributed replicated block device
PDF
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
PDF
Complete squid & firewall configuration. plus easy mac binding
PDF
Athenticated smaba server config with open vpn
PDF
Free radius billing server with practical vpn exmaple
PDF
One key sheard site to site open vpn
PDF
Usrt to ethernet connectivity over the wolrd cubieboard bords
PDF
Site to-multi site open vpn solution with mysql db
PDF
Site to-multi site open vpn solution. with active directory auth
DOCX
Site to-multi site open vpn solution-latest
DOCX
Install elasticsearch, logstash and kibana
PDF
Oracle cluster installation with grid and nfs
PDF
Oracle cluster installation with grid and iscsi
PDF
AUTOMATIC JBOSS CLUSTER MANAGEMENT SYSTEM (PYTHON)
PDF
ully Automatic WSO2 Enterprise Service Bus(ESB) Cluster Management System
PPTX
Docker framework
Storing, Managing, and Deploying Docker Container Images with Amazon ECR
Building A Kubernetes App With Amazon EKS
ERP System Implementation Kubernetes Cluster with Sticky Sessions
Free radius for wpa2 enterprise with active directory integration
Distributed replicated block device
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Complete squid & firewall configuration. plus easy mac binding
Athenticated smaba server config with open vpn
Free radius billing server with practical vpn exmaple
One key sheard site to site open vpn
Usrt to ethernet connectivity over the wolrd cubieboard bords
Site to-multi site open vpn solution with mysql db
Site to-multi site open vpn solution. with active directory auth
Site to-multi site open vpn solution-latest
Install elasticsearch, logstash and kibana
Oracle cluster installation with grid and nfs
Oracle cluster installation with grid and iscsi
AUTOMATIC JBOSS CLUSTER MANAGEMENT SYSTEM (PYTHON)
ully Automatic WSO2 Enterprise Service Bus(ESB) Cluster Management System
Docker framework

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
The AUB Centre for AI in Media Proposal.docx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectral efficient network and resource selection model in 5G networks
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
cuic standard and advanced reporting.pdf
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm

Ask by linux kernel add or delete a hdd

  • 1. pg. 1 by chanakan@cclk.lk ASK BY LINUX KERNEL ADD OR DELETE A HDD TO DELETE: The HDD need to be deactivated Temporally, echo 1 > /sys/block/sdc/device/delete echo 1 > /sys/block/sde/device/delete To verify, pvs -a -o +dev_size Or the HDD need to be deactivated Permanently, before suspend. To make it permanent, add the following file in /etc/pm/sleep.d/ , -rwxr-xr-x 1 root root 204 Dec 6 16:03 99_delete_sdc -rwxr-xr-x 1 root root 204 Dec 6 16:03 99_delete_sde With Content: #!/bin/sh # Delete the failing disk so that it will not block suspend case "$1" in suspend|hibernate) if [ -d /sys/block/sdc ]; then echo 1 > /sys/block/sdc/device/delete fi if [ -d /sys/block/sde ]; then echo 1 > /sys/block/sde/device/delete fi ;; esac TO ADD IT BACK: Issue the following to add it back, echo "- - -" > /sys/class/scsi_host/host0/scan echo "- - -" > /sys/class/scsi_host/host1/scan echo "- - -" > /sys/class/scsi_host/host2/scan init 6 cd /sys/block ; ls && pvs -a -o +dev_size