[SOLVED] How to remove USB drive safe from PVE host SOLVED

muekno

Member
Dec 15, 2023
61
1
8
I added a 1TB drive to my PVE host as a temporary storage for exported VM from my ESXi. I do not remember the exact procedure.
I can access it from the shell at /media/usb/
But I can not find it as a storage in the gui nor via df -h nor I can find a mount point
I would not unplug it just so, I do think of data loss as after importing the VM i deleted the just temporary files
What shall I do?
Please help
 
If it is not mounted you shouldn't be able to see the files in "/media/usb" unless you wrote to an empty mountpoint so the stuff is on your root filesystem and not on the USB device. Running mount without params should give you a list of all active mounts.
 
Last edited:
Thats my problem. i am not new to Linux. have quite a lot of servers running on ESXi and now their are running on PROXMOX, but I a relative new to PROXMOX

I had quite large files (500Gb + some smaler) on that USB Disk. They never would have place on the 140GB PROXMOX system disk and the quit smaler 50GB local datastore. My VMs are on 1TB mirrored ZFS volume.

Mount gives me a lot of mount information but nothing about the usb disk. mount | grep usb shows nothing.
I wouldn't ask here if it would be so easy.
I just have some understanding problems with the PROXMOX storage structure, so i.e. my ZFS Store ist /VMs the name is VM_Space.
But if I do ls /VMs i see all emty, if I go to VM_Store in the GUI I see all my VM disks.
 
PVE creates virtual disks as zvols, which are block devices. They are not files, so all programs like "ls" that will work with filesystems can't show them.
You will have to work with the "zfs" command. Like zfs list.
 
OK thank you, alle the years I just worked with ext 4 on my servers and with vmfs on ESXi I did not beed to know more, Now with PROXMOX I decieded to use ZFS in case of its simple install and lot of posibilities. I still have a lack of knowlage on ZFS :-(
But what about my USB drive
 
Code:
root@pverh:/# ls -l /dev/disk/by-id/usb*
ls: cannot access '/dev/disk/by-id/usb*': No such file or directory
root@pverh:/#

Code:
root@pverh:/#
root@pverh:/# cd /media
root@pverh:/media# cd usb
root@pverh:/media/usb# ll
total 8
drwxr-xr-x 2 root root 4096 Apr 21 18:25 .
drwxr-xr-x 3 root root 4096 Apr 15 15:10 ..
-rw-r--r-- 1 root root    0 Apr 21 18:25 test

USB drive was /dev/sdd, /dev/sda is the system drive, /dev/sdb/ and /dev/sdc are the two 1Tb HDs mirrored with ZFS
Code:
oot@pverh:/media/usb# zpool status
  pool: VMs
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        VMs         ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0

errors: No known data errors


As I wrote I have the large files deleted after import, the file test was created with touch, just to show something may be in.
But I can remove the drive, it was just for me to see how it works if I will have an USB drive with valuable data
 
Code:
root@pverh:/media/usb# umount /dev/sdd
umount: /dev/sdd: no mount point specified.
root@pverh:/media/usb# eject /dev/sdd
eject: /dev/sdd: not found mountpoint or device with the given name
root@pverh:/media/usb# umount /media
umount: /media: not mounted.
root@pverh:/media/usb# umount /media/usb
umount: /media/usb: not mounted.
root@pverh:/media/usb# 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=20544304k,nr_inodes=5136076,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=4115600k,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)
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=23585)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
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)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
VMs on /VMs type zfs (rw,relatime,xattr,noacl,casesensitive)
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)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=4115596k,nr_inodes=1028899,mode=700,inode64)
root@pverh:/media/usb#

Why I think it is still mounted, I still can write to it
Code:
root@pverh:/media/usb# cd /root
root@pverh:~# ll
total 23488
drwx------  3 root root     4096 Apr 20 14:06 .
drwxr-xr-x 19 root root     4096 Apr 15 15:46 ..
-rw-------  1 root root     6461 Apr 21 16:33 .bash_history
-rw-r--r--  1 root root      571 Apr 10  2021 .bashrc
-rw-r--r--  1 root root       31 Apr 19 10:02 .forward
-rw-------  1 root root       51 Apr 11 17:45 .ovftool.ssldb
-rw-r--r--  1 root root      161 Jul  9  2019 .profile
-rw-------  1 root root     1024 Apr 11 12:01 .rnd
drwx------  2 root root     4096 Apr 11 12:01 .ssh
-rw-------  1 root root      820 Apr 11 17:24 .viminfo
-rw-r--r--  1 root root 24001576 Apr 11 17:20 VMware-ovftool-4.4.3-18663434-lin.x86_64.zip
-rw-r--r--  1 root root      215 Apr 19 13:19 .wget-hsts
root@pverh:~# cp VMware-ovftool-4.4.3-18663434-lin.x86_64.zip /media/usb
root@pverh:~# ll /media/usb
total 23448
drwxr-xr-x 2 root root     4096 Apr 21 19:47 .
drwxr-xr-x 3 root root     4096 Apr 15 15:10 ..
-rw-r--r-- 1 root root        0 Apr 21 18:25 test
-rw-r--r-- 1 root root 24001576 Apr 21 19:47 VMware-ovftool-4.4.3-18663434-lin.x86_64.zip
root@pverh:~#
 
Why I think it is still mounted, I still can write to it
Like already said, you are probably just writing to a folder on your root filesystem, not to the USB disk.

And the root filesystem isn't "/root". Its "/" and everything below it that isn`t a mounted mountpoint...

Run "df -h" and write down the free space of your root filesystem. Copy 20GB of data to /media/usb. Run "df -h" again. Root filesystem should be 20GB bigger now.
 
Last edited:
  • Like
Reactions: leesteken
Code:
root@pverh:~# find / -name VMware-ovftool-4.4.3-18663434-lin.x86_64.zip
/root/VMware-ovftool-4.4.3-18663434-lin.x86_64.zip
find: ‘/proc/475786’: No such file or directory
/media/usb/VMware-ovftool-4.4.3-18663434-lin.x86_64.zip
root@pverh:~#

May be, but that was the path I exported my 500gb ESXi VM to and restored it from there. The /dev/sda drive has only 146GB
I will unplug the drive that should not harm and the do the find again, looking what happens.
Still the same, OK sometime in IT you should accept things as their. If they produce no failure, dont't think about.
Thanks for your help and patience
Good evening
 

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!