How does Linux decide if a drive is removable?

Deadjasper

2[H]4U
Joined
Oct 28, 2001
Messages
2,568
Redid my box a while back. It contains 2 1.9TB SSD's. Linux was installed on one of them and the second is a data drive. The second drive was marked as removable which is stupid as shit. When you connect to a remote computer using Remmina the share folder is not stored and you have to reconnect it each time you remote in if it's a removable drive.

I Googled how to make it non removable and found a long page of instructions on how to do this. Is there an easy way? I'd rather back up the drive and reformat than slog through a page full of syntax.

I'd like to understand how this happened in the first place so I can avoid it in the future but as usual, Google returns a bunch of irrelevance on this subject. If someone can enlighten me I'd be forever grateful.

P.S. - OC Is Linux Mint Cinnamon 20.2. Both drives are on the same builtin controller.
 
Check /etc/fstab how the drive was mounted. Probably a Mint related problem. It's been done to please Windows users so you get weird problems too.
 
Has to do with the type of drive and how it reports itself to the OS, iirc, maybe how it's connected, too. The rules are defined in the hardware abstraction layer's configuration, I think. Not sure what the HAL is called nowadays or where the config is.
 
Here's my fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=a7627f79-c242-4e4a-9f47-10078c13ab69 / ext4 errors=remoun>
# /boot/efi was on /dev/sda1 during installation
UUID=87FD-4AA0 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw >
/dev/disk/by-id/wwn-0x50014ee003eb6800-part1 /mnt/wwn-0x50014ee003eb6800-part1 >
 
The drive is formatted Ext4. /dev/sdb1.

I've backed it up so if somebody can tell me how to delete it and add it back as non removable that would solve the problem.

Thanks
 
The drive is formatted Ext4. /dev/sdb1.

I've backed it up so if somebody can tell me how to delete it and add it back as non removable that would solve the problem.

Thanks
Your fstab listing was incomplete (future hint, do not copypaste them from an editor but cat the file instead, then you can copy it in full) but generally speaking you mount the drive in fstab. You can use sudo umount /dev/sdb1 command to unmount the drive manually and then use sudo mount -a after editing the fstab. Use similar settings like you did with your root drive. Or *cough* Mint used for you lol.
 
Last edited:
Trying it again. This is all of it. Don't know what "cat the file" means, sorry.


Code:
  GNU nano 4.8                       /etc/fstab                                 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=a7627f79-c242-4e4a-9f47-10078c13ab69 /               ext4    errors=remoun>
# /boot/efi was on /dev/sda1 during installation
UUID=87FD-4AA0  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw           >
/dev/disk/by-id/wwn-0x50014ee003eb6800-part1 /mnt/wwn-0x50014ee003eb6800-part1 >








^G Get Help  ^O Write Out ^W Where Is  ^K Cut Text  ^J Justify   ^C Cur Pos
^X Exit      ^R Read File ^\ Replace   ^U Paste Text^T To Spell  ^_ Go To Line
 
cat is a program whose function is to concatenate two or more files and output the results to stdout (usually a virtual terminal or alternatively another file/program). It is also often used to read the entirety of a single file, either to print on screen or send to a program.

That isn't really useful, though, as you want the contents in the clipboard so you can paste it on the forum. I'm not sure of the best way to do that other than using a graphic editor or a command line editor which displays the whole contents, breaking lines where necessary.

Nano (the editor you appear to be using) allows lines to continue past the edge of the buffer, and scrolls as necessary while editing. Which is nice for editing, but leaves some of the lines cut off if you just copy the contents of the terminal's buffer.
 
What you see above is all there is to fstab. No scrolling up or down. I did a select all copy.

Are you saying there's more to fstab than what I'm seeing? How do I access the rest of it?

Thanks
 
Literally type `cat /etc/fstab` in terminal. Then highlight, left click to copy, and paste here.
 
What you see above is all there is to fstab. No scrolling up or down. I did a select all copy.

Are you saying there's more to fstab than what I'm seeing? How do I access the rest of it?

Thanks
Yeah, those greater than ('>') symbols indicate there's more on the right that you can't see currently. What Eulogy said should work.
 
Code:
sparkey@sparkey-desktop:~$ sudo cat /etc/fstab
[sudo] password for sparkey:         
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=a7627f79-c242-4e4a-9f47-10078c13ab69 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=87FD-4AA0  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
/dev/disk/by-id/wwn-0x50014ee003eb6800-part1 /mnt/wwn-0x50014ee003eb6800-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
sparkey@sparkey-desktop:~$
 
What's your sudo lsblk output? I'm suspecting that the problem drive has been mounted through Mint GUI (the x-gvfs-show is a giveaway). In that case you just need to mount it manually in fstab (change the settings similar to your root drive) and your problem is gone.

i.e. if the disk-by-id drive is your current sdb1, change fstab to something like this:
sudo mkdir /mnt/drive2
Then edit fstab to be:
/dev/disk/by-id/wwn-0x50014ee003eb6800-part1 /mnt/drive2 ext4 defaults 0 0
 
sparkey@sparkey-desktop:~$ sudo lsblk
[sudo] password for sparkey:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 1.8T 0 part /run/timeshift/backup
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 1.8T 0 part
sr0 11:0 1 1024M 0 rom
sparkey@sparkey-desktop:~$
 
What's your sudo lsblk output? I'm suspecting that the problem drive has been mounted through Mint GUI (the x-gvfs-show is a giveaway). In that case you just need to mount it manually in fstab (change the settings similar to your root drive) and your problem is gone.

i.e. if the disk-by-id drive is your current sdb1, change fstab to something like this:
sudo mkdir /mnt/drive2
Then edit fstab to be:
/dev/disk/by-id/wwn-0x50014ee003eb6800-part1 /mnt/drive2 ext4 defaults 0 0

I did this and it's still mounting the drive as removable. :banghead:
 
I did this and it's still mounting the drive as removable. :banghead:
do a sudo blkid |grep sdb to verify fstab had exactly that disk mounted there. Are those the only 2 drives or is there a 3rd one? Also, did you reboot after the fstab change?
 
Wait hold on.... you know I don't think there is anything wrong with your drive.

Your running mint and Cinnamon right ? I think your GUI file manager is simply giving you the option to unmount the drive. Check the settings in your file manager. Check the mount options... and see if their is a tick box that says something like "show in user interface" or something like that. If there is untick and see if your unmount option from the file manager disappears. Some GUI file managers show unmount options... but they in general won't show them for the drive the OS is running on.
 
Code:
/dev/sdb1: LABEL="Data2" UUID="07dde97d-c692-4238-bdd4-8165d06d8a70" TYPE="ext4" PARTUUID="a268c209-01"

Only 2 drives installed. Boot drive and problem drive.
 
after changing the mnt to data2 it's taking forever to boot. Guess I need to change it back. I did backup fstab before proceeding so just gotta research the delete and rename commands.

Yea, guess it could be a Remmina issue. Here's how the problem appeared - I had a spinner as a data drive but since I had a spare 1.92 SSD I thought I'd swap out the spinner for the SSD and thus lower the energy consumption. Since this box stays on all day I figured it would be worth it. before I replaced the spinner all was well, it was not seen as removable. Only after I replaced it with the SSD did this problem appear.
 
After re-reading the original question the 'share folder' stuck to my eye. This may be entirely a Remmina based problem and not actually have anything to do with the disk mounting.

https://stackoverflow.com/questions/61290603/how-does-remmina-folder-sharing-work-in-linux

What you could do still is try mounting the other drive by the UUID in fstab like the root drive was.

Rarely, if ever, do I need to share a folder. I prefer to share the whole drive but for some reason Linux seems to be hung up on sharing folders and says nothing about sharing entire drives. :banghead:
 
Wait hold on.... you know I don't think there is anything wrong with your drive.

Your running mint and Cinnamon right ? I think your GUI file manager is simply giving you the option to unmount the drive. Check the settings in your file manager. Check the mount options... and see if their is a tick box that says something like "show in user interface" or something like that. If there is untick and see if your unmount option from the file manager disappears. Some GUI file managers show unmount options... but they in general won't show them for the drive the OS is running on.

I found this command in Preference Disks and when I uncheck it the drive isn't mounted at all.
 
I need to point out that before I swapped the spinner for the SSD Remmina worked like it should and the drive did not show as removable (unmountable?)

I assumed the two were related hence my pursuing the removable issue.
 
Isn't remmina just an RDP/SSH/VNC all-in-one client? I'm failing to see how it's relevant here. :)
 
Rarely, if ever, do I need to share a folder. I prefer to share the whole drive but for some reason Linux seems to be hung up on sharing folders and says nothing about sharing entire drives. :banghead:
In linux you create mount points and share those usually. The whole 'folder' thing is just a Remmina feature.
 
Shared folders need to be configured in the Remmina conf, that's how.
That's sharing a folder between the client and the remote system, isn't it? Wondering if we're all talking about different things here...
 
I found this command in Preference Disks and when I uncheck it the drive isn't mounted at all.
Ya I'm sorry brain fart on my part. That is a disks option that just makes the drive not show up in GUI file managers.

In your file manager though just a quick question.... is it actually an "eject" option or does it say unmount. Cause if it says unmonut that is normal expected behaviour for internal drives. (all my drives have a unmount button beside them in the GUI) Thumb drives ect should say eject... as they will write cache first.
 
The problem is when I share the drive, Data2, in Remmina it doesn't stick. Well sorta, it sticks but shows as empty on the remote system and as (none) in the Remmina config GUI. I assumed it was because the drive is showing as removable. Maybe I started at the wrong end of this problem. :confused:
 
Ya I'm sorry brain fart on my part. That is a disks option that just makes the drive not show up in GUI file managers.

In your file manager though just a quick question.... is it actually an "eject" option or does it say unmount. Cause if it says unmonut that is normal expected behaviour for internal drives. (all my drives have a unmount button beside them in the GUI) Thumb drives ect should say eject... as they will write cache first.

Hell, it's getting worse. The button unmounts the drive. I clicked it and got the authentication dialog. I hit cancel and it kept popping back up. I finally hit unmount and expected the drive to be gone, but it's not. Shit, this ain't my day. :banghead:
 
I mean more of like, what you are trying to do overall. Like, what is the reason you're wanting to share a drive, regardless of using remmina's sharing setup or not
 
I mean more of like, what you are trying to do overall. Like, what is the reason you're wanting to share a drive, regardless of using remmina's sharing setup or not

To transfer files between this computer and the remote. What else would I being trying to do?

As for the drive, yes, I want to share the DRIVE, not just folders in the drive. The entire drive which means everything on it. It's a data drive meant to be shared.
 
To transfer files between this computer and the remote. What else would I being trying to do?

As for the drive, yes, I want to share the DRIVE, not just folders in the drive. The entire drive which means everything on it. It's a data drive meant to be shared.
In that case I'd completely stop using remmina for that, and would simply setup real file sharing on the linux box. Setup an NFS share, and mount it where ever you want. Ez pz.
 
In that case I'd completely stop using remmina for that, and would simply setup real file sharing on the linux box. Setup an NFS share, and mount it where ever you want. Ez pz.

Using Remmina is convenient for a couple of reasons. 1. A simple check used to make it fully automatic which is what I'm trying to get back to. 2. I need this share when I'm connected remotely. Most connections are to Windows Server.

When I set Remmina to connect Data2 drive it works like it should. But only for that session. If I disconnect and go to connect again, Data2 shows up in Windows Explorer on the remote system but in Remmina config I see this where previously it showed Data2. In other words it forgetting Data2 and replacing it with (none). That is the problem.

Sorry, I should have stated this in the beginning rather tan assuming I knew what the problem was. My apologies.

Screenshot from 2021-09-27 19-35-12.png
 
Last edited:
Back
Top