How to unmount USB drive which is not in FSTAB

Rossco

New Member
Jan 3, 2025
4
0
1
I have a problem with a USB drive that I have auto-mounted to /media and the drive mounts every time I boot the system.

I followed a tutorial somewhere months ago and mounted this drive. Now I cannot unmount it, as there is no entry in the fstab file, and unfortunately, I did not keep notes of the process used to mount it.

I have searched everywhere for how to fix this, but cannot find an answer. Any suggestions on how to remove this drive properly would be greatly appreciated.

Here is my fstab file:
Bash:
root@pve:/# cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/pve/root / ext4 errors=remount-ro 0 1
UUID=635D-5F52 /boot/efi vfat defaults 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0
root@pve:/#

The disk is mounted as sdb and shows up in the lsblk command without a mount point:
Bash:
root@pve:/# lsblk
NAME                                              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                                                 8:0    0 119.2G  0 disk
├─sda1                                              8:1    0  1007K  0 part
├─sda2                                              8:2    0     1G  0 part /boot/efi
├─sda3                                              8:3    0    19G  0 part
│ ├─pve-swap                                      252:0    0   2.3G  0 lvm  [SWAP]
│ └─pve-root                                      252:1    0   8.4G  0 lvm  /
└─sda4                                              8:4    0  99.2G  0 part
sdb                                                 8:16   0 223.6G  0 disk
root@pve:/#

The drive shows up in the GUI as follows:
Screenshot 2025-01-03 200620.png
 
umount /dev/sdb
Tried that. The device is not mounted...
Bash:
root@pve:/# umount /dev/sdb
umount: /dev/sdb: not mounted.
root@pve:/#

in fact, the device does not show up as mounted from the mount command:
Bash:
root@pve:/# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3977076k,nr_inodes=994269,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=802180k,mode=755,inode64)
/dev/mapper/pve-root on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=6245)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-tmpfiles-setup-dev.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
/dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-tmpfiles-setup.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
/dev/fuse on /etc/pve type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=802176k,nr_inodes=200544,mode=700,inode64)
 
. Now I cannot unmount it, as there is no entry in the fstab file, and unfortunately, I did not keep notes of the process used to mount it.
There doesn't need to be an entry in the "fstab" to unmount a manually mounted device.
In all of your outputs there is no evidence that the device is "mount"'ed in a Linux OS sense of the word.
You said that:
The disk is mounted as sdb
This is not a correct interpretation of the output you posted. The device is recognized and presented as "sdb" - it is not mounted.
You can simply yank the device from the system if you want "sdb" to be removed.



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: Kingneutron
Check lsblk -o+FSTYPE /dev/sdb and file -Ls /dev/sdb see if there's even a file system on the disk.
systemctl list-units --type mount can help with finding systemd mounts.
The disk is mounted as sdb and shows up in the lsblk command without a mount point
What's the issue exactly? Do you expect the device to disappear if a potential file system on it is unmounted?
 
Last edited:
There doesn't need to be an entry in the "fstab" to unmount a manually mounted device.
In all of your outputs there is no evidence that the device is "mount"'ed in a Linux OS sense of the word.
You said that:

This is not a correct interpretation of the output you posted. The device is recognized and presented as "sdb" - it is not mounted.
You can simply yank the device from the system if you want "sdb" to be removed.



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
The device is not manually mounted. and the unmount command will not remove it.

If I yank the device, then I get errors in the system log when it boots.
usb 1-4: device descriptor read/64, error -71
 
Check lsblk -o+FSTYPE /dev/sdb and file -Ls /dev/sdb see if there's even a file system on the disk.
systemctl list-units --type mount can help with finding systemd mounts.

What's the issue exactly? Do you expect the device to disappear if a potential file system on it is unmounted?
The issue is that I wish to remove the drive from the system. If I just unplug it, I get boot errors in the system log. I would like to remove it properly.

Output from your commands:
Bash:
root@pve:~# lsblk -o+FSTYPE /dev/sdb
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS FSTYPE
sdb    8:16   0 223.6G  0 disk
root@pve:~# file -Ls /dev/sdb
/dev/sdb: data

It is formatted as EXT4 and has some test data. Nothing valuable.

Bash:
root@pve:~# systemctl list-units --type mount
  UNIT                                                              LOAD   ACTIVE SUB     DESCRIPTION
  -.mount                                                           loaded active mounted Root Mount
  boot-efi.mount                                                    loaded active mounted /boot/efi
  dev-hugepages.mount                                               loaded active mounted Huge Pages File System
  dev-mqueue.mount                                                  loaded active mounted POSIX Message Queue File System
  etc-pve.mount                                                     loaded active mounted /etc/pve
  proc-sys-fs-binfmt_misc.mount                                     loaded active mounted Arbitrary Executable File Formats File System
  run-credentials-systemd\x2dsysctl.service.mount                   loaded active mounted /run/credentials/systemd-sysctl.service
  run-credentials-systemd\x2dsysusers.service.mount                 loaded active mounted /run/credentials/systemd-sysusers.service
  run-credentials-systemd\x2dtmpfiles\x2dsetup.service.mount        loaded active mounted /run/credentials/systemd-tmpfiles-setup.service
  run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount loaded active mounted /run/credentials/systemd-tmpfiles-setup-dev.service
  run-rpc_pipefs.mount                                              loaded active mounted RPC Pipe File System
  run-user-0.mount                                                  loaded active mounted /run/user/0
  sys-fs-fuse-connections.mount                                     loaded active mounted FUSE Control File System
  sys-kernel-config.mount                                           loaded active mounted Kernel Configuration File System
  sys-kernel-debug.mount                                            loaded active mounted Kernel Debug File System
  sys-kernel-tracing.mount                                          loaded active mounted Kernel Trace File System
  var-lib-lxcfs.mount                                               loaded active mounted /var/lib/lxcfs

Did not show up there.
 
The issue is that I wish to remove the drive from the system. If I just unplug it, I get boot errors in the system log. I would like to remove it properly.
This is a critical part of the problem description.

Examine your /etc/rcX.d scripts
Look at "systemd-analyze blame"

Or, best of all, find the guide you used to modify your system and use it to undo the changes.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!