LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-16-2023, 11:24 PM   #1
TheJooomes
Member
 
Registered: May 2019
Posts: 226

Rep: Reputation: 2
How do I disable an internal SATA drive by identifying it specifically?


After unmounting and running sync, I'd like to completely turn off the 2nd internal SSD, as part of a script. Echoing 1 to /sys/block/sda/device/delete seems to have the effect that I want, but it specifies the drive via sda. I'd much prefer by-id or similar because sda is flexible and could change if I plug in another drive. So is there a better way to specify the desired drive?
 
Old 03-17-2023, 12:28 AM   #2
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,557

Rep: Reputation: 532Reputation: 532Reputation: 532Reputation: 532Reputation: 532Reputation: 532
You can disk get uuids e.g. by running 'lsblk -o +UUID'. Also, running sync after umount is useless and before is pointless - umount syncs filesystem anyway.
 
Old 03-17-2023, 12:37 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,396

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
UUID is simply a link - and is not guaranteed to be unique despite its name. Even in your own environment. As the base device doesn't have a UUID, you'd have to slice-and-dice the result anyway.
Maybe try the wwid instead ?.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Disable cd/dvd write capability in Linux; specifically The Tool Brasero johnmccarthy Linux - Newbie 4 05-09-2014 01:17 PM
[SOLVED] transfer data from a SATA external hard drive to a IDE internal hard drive Cabtech Linux - Newbie 7 04-22-2012 02:55 PM
Internal SATA Drive and external SATA Disk Array. bruceharbin Linux - Hardware 1 05-25-2009 12:33 AM
Copy an internal hard drive as backup? Restore an internal drive? Peufelon Linux - Hardware 2 06-15-2008 03:28 PM
Identifying internal modem Acer 5610Z Ubuntu 7.04 mfdc1969 Linux - Hardware 8 10-15-2007 12:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration