LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-30-2022, 09:35 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Rep: Reputation: Disabled
Hard disk on internal SATA bus recognized as removable. How to change?


This is on a Gigabyte X570 Aorus Elite with an AMD Ryzen 9 5900X 12-Core Processor. Operating systems reside on two NVME SSDs. I want to avoid an accidental "ejection" (unmounting) of the hard disk. How can I teach the system that it is not a removable disk?
 
Old 07-30-2022, 12:30 PM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,514

Rep: Reputation: Disabled
If it gets mounted at boot, via /etc/fstab entry, it shouldn't get unmounted - unless you do it manually as root, or with sudo.
 
Old 07-30-2022, 01:31 PM   #3
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
More information is needed, or pick post #2; mount the device via an fstab entry which is how you should do that.
Code:
lsblk
cat /etc/fstab
 
Old 07-30-2022, 03:53 PM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,873
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
Originally Posted by JZL240I-U View Post
I want to avoid an accidental "ejection" (unmounting) of the hard disk. How can I teach the system that it is not a removable disk?
Configure the same way now as more than two decades ago, by putting it /etc/fstab. Use the noauto mount option if perchance you wish it not to always be mounted.
 
Old 07-31-2022, 03:13 PM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fatmac View Post
If it gets mounted at boot, via /etc/fstab entry, it shouldn't get unmounted - unless you do it manually as root, or with sudo.
Umm, I use Plasma and its Plasmoids(?) or whatever offer ejection of the drive. I'd rather not ... .
 
Old 07-31-2022, 03:16 PM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Debian6to11 View Post
More information is needed, or pick post #2; mount the device via an fstab entry which is how you should do that.
Code:
lsblk
cat /etc/fstab
This is /etc/fstab:
Code:
me@ryzen:~> cat /etc/fstab
...
/dev/sda1                                  /backup                 ext4   defaults                      0  2
...
me@ryzen:~>
Something wrong with that?

@mrmazda Do you see something amiss here?

Last edited by JZL240I-U; 07-31-2022 at 03:17 PM.
 
Old 07-31-2022, 04:43 PM   #7
Patrick59
Member
 
Registered: Apr 2007
Location: North France
Distribution: Slackware64 15.0
Posts: 74

Rep: Reputation: 19
Is Hotplug enable in BIOS for the drives ?
Try to disable it and let us know.

hth,
 
Old 08-01-2022, 06:49 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Original Poster
Rep: Reputation: Disabled
Ups, I just noticed that I missed the request for "lsblk". Here it is:
Code:
me@ryzen:~> sudo lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    1   5,5T  0 disk 
└─sda1        8:1    1   1,9T  0 part /backup
nvme1n1     259:0    0 931,5G  0 disk 
├─nvme1n1p1 259:1    0   512M  0 part 
├─nvme1n1p2 259:2    0   100G  0 part 
├─nvme1n1p3 259:3    0  97,7G  0 part 
├─nvme1n1p4 259:4    0  97,7G  0 part 
└─nvme1n1p5 259:5    0  93,1G  0 part 
nvme0n1     259:6    0 931,5G  0 disk 
├─nvme0n1p1 259:7    0   512M  0 part /boot/efi
├─nvme0n1p2 259:8    0   929G  0 part /var
│                                     /usr/local
│                                     /srv
│                                     /root
│                                     /opt
│                                     /home
│                                     /boot/grub2/x86_64-efi
│                                     /boot/grub2/i386-pc
│                                     /.snapshots
│                                     /
└─nvme0n1p3 259:9    0     2G  0 part [SWAP]
me@ryzen:~>
@Patrick59 I'll check the BIOS after next reboot, thanks for the pointer.
 
Old 08-01-2022, 08:28 AM   #9
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
You have already assigned a disk in fstab (sda1). What keeps you from doing the same with the disk in OP? (must be nvmen1)
 
Old 08-01-2022, 09:05 AM   #10
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,873
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
Originally Posted by JZL240I-U View Post
Code:
me@ryzen:~> cat /etc/fstab
...
/dev/sda1                                  /backup                 ext4   defaults                      0  2
...
me@ryzen:~>
@mrmazda Do you see something amiss here?
Technically no. Ideally, you want to minimize opportunity for surprise failures. An example frequently encountered is booting while a USB stick forgotten about is still inserted. It is typical for a BIOS to assign names to USB sticks before internal drives. That could make your normal sda1 enumerate as sdb1 or sde1, fail to mount, and prevent a normal startup.

For mounting, the optimal way to avoid surprises is to mount by something other than device name, generally meaning either by UUID or by volume LABEL. UUIDs are always created unique. LABELs are as unique as you care to make them, meaning, among other things, you can purposely replicate volumes meant to be rotated through one particular mount point, though this latter is wholly unsuited to internal drives.

Last edited by mrmazda; 08-01-2022 at 05:58 PM. Reason: Left out the part about cloning destroying the uniqueness of UUID creation.
 
Old 08-01-2022, 09:46 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Debian6to11 View Post
You have already assigned a disk in fstab (sda1). What keeps you from doing the same with the disk in OP? (must be nvmen1)
sda1 is my problem child, getting mounted as removable.
 
Old 08-01-2022, 10:15 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mrmazda View Post
Technically no. Ideally, you want to minimize opportunity for surprise failures. An example frequently encountered is booting while a USB stick forgotten about is still inserted. It is typical for a BIOS to assign names to USB sticks before internal drives. That could make your normal sda1 enumerate as sdb1 or sde1, fail to mount, and prevent a normal startup.

For mounting, the optimal way to avoid surprises is to mount by something other than device name, generally meaning either by UUID or by volume LABEL. UUIDs are always unique. LABELs are as unique as you care to make them, meaning, among other things, you can purposely replicate volumes meant to be rotated through one particular mount point, though this latter is wholly unsuited to internal drives.
There is no stick inserted.

I changed /etc/fstab as you suggested:
Code:
me@ryzen:~> cat /etc/fstab
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /                       btrfs  defaults                      0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /var                    btrfs  subvol=/@/var                 0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /usr/local              btrfs  subvol=/@/usr/local           0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /srv                    btrfs  subvol=/@/srv                 0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /root                   btrfs  subvol=/@/root                0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /opt                    btrfs  subvol=/@/opt                 0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /home                   btrfs  subvol=/@/home                0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01  /.snapshots             btrfs  subvol=/@/.snapshots          0  0
UUID=7c5b0e30-2117-4c1a-abde-b38953b49a06  swap                    swap   defaults                      0  0
UUID=D1CD-79A5                             /boot/efi               vfat   utf8                          0  2
#/dev/sda1                                  /backup                 ext4   defaults                      0  2
UUID=792fc662-3296-4884-8743-4868ce71f55c  /backup                 ext4   defaults                      0  2
me@ryzen:~>
Then I issued "sudo umount /dev/sda1" followed by "sudo mount -a". But
Code:
me@ryzen:~> lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    1   5,5T  0 disk 
└─sda1        8:1    1   1,9T  0 part /backup
nvme1n1     259:0    0 931,5G  0 disk 
├─nvme1n1p1 259:1    0   512M  0 part 
├─nvme1n1p2 259:2    0   100G  0 part 
├─nvme1n1p3 259:3    0  97,7G  0 part 
├─nvme1n1p4 259:4    0  97,7G  0 part 
└─nvme1n1p5 259:5    0  93,1G  0 part 
nvme0n1     259:6    0 931,5G  0 disk 
├─nvme0n1p1 259:7    0   512M  0 part /boot/efi
├─nvme0n1p2 259:8    0   929G  0 part /var
│                                     /usr/local
│                                     /srv
│                                     /root
│                                     /opt
│                                     /home
│                                     /boot/grub2/x86_64-efi
│                                     /boot/grub2/i386-pc
│                                     /.snapshots
│                                     /
└─nvme0n1p3 259:9    0     2G  0 part [SWAP]
me@ryzen:~>
The disk is still removable. What did I miss?
 
Old 08-01-2022, 01:38 PM   #13
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
There is nothing more I can say here. I have two fstab entries and the partitions are shown as removable devices in nemo file manager. And that is what you want to avoid.
 
Old 08-01-2022, 01:52 PM   #14
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,873
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
Originally Posted by JZL240I-U View Post
The disk is still removable. What did I miss?
Any filesystem not in use can be purposely removed by root, except for /. OP was about accidental ejection.
 
Old 08-01-2022, 02:22 PM   #15
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mrmazda View Post
Any filesystem not in use can be purposely removed by root, except for /. OP was about accidental ejection.
Sure, you can umount any partition you want. In the OP I wanted to avoid Plasma to mark /dev/sda1 as possible to eject. It still is. I want to change that.
 
  


Reply



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
internal hard disk not recognized Upendra Pratap Singh Linux - Hardware 5 05-09-2015 12:52 PM
Dell RD1000 80 GB removable disk recognized as 40 GB Pastorino Linux - Hardware 2 02-19-2012 09:16 AM
How to change retry times of removable disk scan when plug SATA drive into Linux PC? yanzi Linux - Kernel 0 06-17-2011 11:17 PM
Internal SATA Drive and external SATA Disk Array. bruceharbin Linux - Hardware 1 05-25-2009 12:33 AM
HotPlugging IDE hard drives on internal removable bay mauryr Linux - Hardware 4 02-28-2007 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:55 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