Skip to content

Display external hard drives on VDSM #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
GBInformatics opened this issue Jun 9, 2025 · 1 comment
Open

Display external hard drives on VDSM #993

GBInformatics opened this issue Jun 9, 2025 · 1 comment

Comments

@GBInformatics
Copy link

Operating system

Debian 12

Description

Hello, I don't have all the knowledge so I'd like to ask you if it's possible to do what I want to do.

I want to reassemble 2 external hard drives by plugging them into the computer's usb ports.

I can see them and access them on the icons, but nothing on vdsm.
Can you please help me?

Docker compose

services:
  dsm:
    container_name: Virtual_DiskStationManager
    image: vdsm/virtual-dsm:latest
    environment:
      DISK_SIZE: "100G"
      RAM_SIZE: "4G"
      CPU_CORES: "4"
      TITLE: Virtual_DiskStationManager
    stop_grace_period: 2m
    devices:    
      - /dev/kvm
      - /dev/sdb:/dev/sdb  # Périphérique complet        
      - /dev/sdc:/dev/sdc  # Périphérique complet          
      - /dev/sdd:/dev/sdd  # Périphérique complet  
      - /dev/sde:/dev/sde  # Périphérique complet  
      - /dev/sdf:/dev/sdf  # Périphérique complet  
      - /dev/sdg:/dev/sdg  # Périphérique complet
      # Périphériques USB dynamiques
      - /dev/bus/usb:/dev/bus/usb
    privileged: true  # Nécessaire pour l'accès complet aux périphériques
    cap_add:
      - NET_ADMIN
      - SYS_ADMIN
      - SYS_RAWIO
      - MKNOD
    volumes:
      - /home/docker/virtualdiskstationmanager:/storage/virtualdiskstationmanager
      - /mnt/usb-disk:/data/usb-disk    # Ajout pour le disque USB externe
      - /dev:/dev:rw
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
      - /sys/bus/usb:/sys/bus/usb:ro
      - /run/udev:/run/udev:ro
      - /mnt/usb:/usb-data
      - /mnt/usb1:/usb-data1
      - /mnt/usb2:/usb-data2
      - /mnt/usb3:/usb-data3
      - /mnt/usb4:/usb-data4
      - /mnt/usb5:/usb-data5
      - /mnt/usb6:/usb-data6
    restart: on-failure:5
    ports:
      - 10040:5000  
      - 10050:5001
    networks:
      Virtual_DiskStationManager:
        ipv4_address: 172.168.2.1
    
networks:
  Virtual_DiskStationManager:    
    driver: bridge
    ipam:
      config:
        - subnet: 172.168.2.0/24
          gateway: 172.168.2.254

Docker log

N/A

Screenshots (optional)

No response

@xrh0905
Copy link
Contributor

xrh0905 commented Jun 13, 2025

Hi there.
From what you've written, I understand you're attempting to "passthrough" (or allow vDSM to directly manage) your USB External Hard Drives, potentially with the goal of accessing filesystem on them.
To be brief, while technically possible to passthrough USB Hard Drives to vDSM, it is generally not recommended.
Here's why:

  • vDSM Limitations:
    First, vDSM is a limited subset of the full Synology DSM.
    Consequently, vDSM has stripped the ability to manage RAID arrays; it only supports basic volumes.
    Its designed purpose is to access virtual disks only, with the host system intended to manage any underlying RAID configurations.
  • Incorrect Setup & Data Loss Risk:
    Secondly, based on your docker-compose file, I believe your current setup for vDSM disk passthrough is incorrect.
    As I mentioned earlier, vDSM only accepts block devices as a whole, which it then formats as Basic volumes.
    Therefore, if you were to properly set up passthrough, you would LOSE ALL EXISTING data on your USB Hard Drive, as vDSM would directly wipe the disk to create a single Btrfs volume on it.
    However, your docker-compose file appears to contain a few errors that prevent it from actually passing through the disk.
    Additionally, the volume mappings seem misconfigured; the /storage endpoint is incorrectly pointed to /storage/virtualdiskstationmanager, which would likely cause data loss or unexpected behavior.

It's important to understand that vDSM is not a simple Docker container containing a full DSM OS. Instead, it encapsulates a complete KVM environment. Because of this, merely volume mapping USB storage or device mapping within the docker-compose file will have no effect unless the environment variable is correctly configured for passthrough.
Furthermore, since you mentioned that the hard drive is already accessible on your host, this implies it is already formatted and contains data. In this specific case, I strongly advise against attempting to passthrough it to vDSM. Not only will it fail to function properly, but you would also risk losing all your existing data.
If you can provide more context and detail your current setup and goals, I would be happy to assist you further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants