mbentley / docker-timemachine

Docker image to run Samba (compatible Time Machine for macOS)
Apache License 2.0
573 stars 66 forks source link

[Bug]: 6 TB Drive Only Shows 85.2 GB Upon Connection #143

Closed iJasonWade closed 1 year ago

iJasonWade commented 1 year ago

Describe the Bug

I have a 6 TB hard drive I am using for timemachine, but when I connect to it from my Mac it only shows 85.2 GB available.

System Information:

Linux frankyclark 6.2.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 23:39:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Filesystem    1K-blocks         Used   Available         Use%  Mounted on
/dev/sdb       4844127148    5924   4599916312   1%       /home/jason/mnt/timemachine
version: '3.3'
services:
    timemachine:
        restart: always
        container_name: timemachine
        network_mode: host
        environment:
            - ADVERTISED_HOSTNAME=
            - CUSTOM_SMB_CONF=false
            - CUSTOM_USER=false
            - DEBUG_LEVEL=1
            - 'MIMIC_MODEL=TimeCapsule8,119'
            - EXTERNAL_CONF=
            - HIDE_SHARES=no
            - TM_USERNAME=jason
            - TM_GROUPNAME=timemachine
            - TM_UID=1000
            - TM_GID=1000
            - PASSWORD=XXXXXXXXXXX
            - SET_PERMISSIONS=false
            - SHARE_NAME=TimeMachine
            - SMB_INHERIT_PERMISSIONS=no
            - SMB_NFS_ACES=no
            - SMB_METADATA=stream
            - SMB_PORT=445
            - 'SMB_VFS_OBJECTS=acl_xattr fruit streams_xattr'
            - VOLUME_SIZE_LIMIT=0
            - WORKGROUP=WORKGROUP
        volumes:
            - '/home/jason/mnt/timemachine:/opt/timemachine'
            - '/home/jason/mnt/timemachine/samba:/var/lib/samba'
            - '/home/jason/mnt/timemachine/cache-samba:/var/cache/samba'
            - '/home/jason/mnt/timemachine/run-samba:/run/samba'
        image: 'mbentley/timemachine:smb-20230501'
timemachine

Expected Behavior

Full available space is accessible.

Steps to Reproduce

Run docker-compose Connect to timemachine from Mac Observe available space

How You're Launching the Container

`docker-compose up -d`

Container Logs

timemachine    | INFO: CUSTOM_SMB_CONF=false; generating [global] section of /etc/samba/smb.conf...
timemachine    | INFO: Creating /var/lib/samba/private
timemachine    | INFO: Creating /var/log/samba/cores
timemachine    | INFO: Avahi - generating base configuration in /etc/avahi/services/smbd.service...
timemachine    | INFO: Avahi - adding the 'dk0', 'TimeMachine' share txt-record to /etc/avahi/services/smbd.service...
timemachine    | INFO: Group timemachine doesn't exist; creating...
timemachine    | INFO: User jason doesn't exist; creating...
timemachine    | INFO: Setting password from environment variable
timemachine    | chpasswd: password for 'jason' changed
timemachine    | INFO: INFO: CUSTOM_SMB_CONF=false; generating [TimeMachine] section of /etc/samba/smb.conf...
timemachine    | INFO: Samba - Created Added user jason.
timemachine    | INFO: Samba - Enabled user jason.
timemachine    | INFO: Samba - setting password
timemachine    | INFO: SET_PERMISSIONS=false; not setting ownership and permissions for /opt/jason
timemachine    | INFO: Avahi - completing the configuration in /etc/avahi/services/smbd.service...
timemachine    | INFO: running test for xattr support on your time machine persistent storage location...
timemachine    | INFO: xattr test successful - your persistent data store supports xattrs
timemachine    | INFO: entrypoint complete; executing 's6-svscan /etc/s6'
timemachine    | dbus socket not yet available; sleeping...
timemachine    | nmbd version 4.16.10 started.
timemachine    | Copyright Andrew Tridgell and the Samba Team 1992-2022
timemachine    | smbd version 4.16.10 started.
timemachine    | Copyright Andrew Tridgell and the Samba Team 1992-2022
timemachine    | INFO: Profiling support unavailable in this build.
timemachine    | Found user 'avahi' (UID 86) and group 'avahi' (GID 86).
timemachine    | Successfully dropped root privileges.
timemachine    | avahi-daemon 0.8 starting up.
timemachine    | WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
timemachine    | Loading service file /etc/avahi/services/smbd.service.
timemachine    | Joining mDNS multicast group on interface veth5cf8eaf.IPv6 with address fe80::88f5:2bff:fed7:56ac.
timemachine    | New relevant interface veth5cf8eaf.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface vethea88d66.IPv6 with address fe80::605d:6fff:fea3:9343.
timemachine    | New relevant interface vethea88d66.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface veth8567602.IPv6 with address fe80::dc6f:4cff:fee0:a91.
timemachine    | New relevant interface veth8567602.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface vethae00bf1.IPv6 with address fe80::b0ea:9bff:fe82:9c4a.
timemachine    | New relevant interface vethae00bf1.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface veth633fc78.IPv6 with address fe80::f46a:82ff:fe43:2ab.
timemachine    | New relevant interface veth633fc78.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-36d35ff85476.IPv6 with address fe80::42:3ff:fe58:44bb.
timemachine    | New relevant interface br-36d35ff85476.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-36d35ff85476.IPv4 with address 172.19.0.1.
timemachine    | New relevant interface br-36d35ff85476.IPv4 for mDNS.
timemachine    | Joining mDNS multicast group on interface docker0.IPv6 with address fe80::42:66ff:fe8d:79d5.
timemachine    | New relevant interface docker0.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface docker0.IPv4 with address 172.17.0.1.
timemachine    | New relevant interface docker0.IPv4 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-bd73a564480d.IPv6 with address fe80::42:b7ff:fe1c:9bc4.
timemachine    | New relevant interface br-bd73a564480d.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-bd73a564480d.IPv4 with address 172.20.0.1.
timemachine    | New relevant interface br-bd73a564480d.IPv4 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-9a3754c0eafd.IPv6 with address fe80::42:c1ff:fe8c:95e2.
timemachine    | New relevant interface br-9a3754c0eafd.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-9a3754c0eafd.IPv4 with address 172.21.0.1.
timemachine    | New relevant interface br-9a3754c0eafd.IPv4 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-853a0bd889a2.IPv6 with address fe80::42:83ff:fe41:9ab6.
timemachine    | New relevant interface br-853a0bd889a2.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface br-853a0bd889a2.IPv4 with address 172.18.0.1.
timemachine    | New relevant interface br-853a0bd889a2.IPv4 for mDNS.
timemachine    | Joining mDNS multicast group on interface enx8cae4cdd6c19.IPv6 with address fdea:89ed:188b:1:8eae:4cff:fedd:6c19.
timemachine    | New relevant interface enx8cae4cdd6c19.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface enx8cae4cdd6c19.IPv4 with address 192.168.6.159.
timemachine    | New relevant interface enx8cae4cdd6c19.IPv4 for mDNS.
timemachine    | Joining mDNS multicast group on interface lo.IPv6 with address ::1.
timemachine    | New relevant interface lo.IPv6 for mDNS.
timemachine    | Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
timemachine    | New relevant interface lo.IPv4 for mDNS.
timemachine    | Network interface enumeration completed.
timemachine    | Registering new address record for fe80::88f5:2bff:fed7:56ac on veth5cf8eaf.*.
timemachine    | Registering new address record for fe80::605d:6fff:fea3:9343 on vethea88d66.*.
timemachine    | Registering new address record for fe80::dc6f:4cff:fee0:a91 on veth8567602.*.
timemachine    | Registering new address record for fe80::b0ea:9bff:fe82:9c4a on vethae00bf1.*.
timemachine    | Registering new address record for fe80::f46a:82ff:fe43:2ab on veth633fc78.*.
timemachine    | Registering new address record for fe80::42:3ff:fe58:44bb on br-36d35ff85476.*.
timemachine    | Registering new address record for 172.19.0.1 on br-36d35ff85476.IPv4.
timemachine    | Registering new address record for fe80::42:66ff:fe8d:79d5 on docker0.*.
timemachine    | Registering new address record for 172.17.0.1 on docker0.IPv4.
timemachine    | Registering new address record for fe80::42:b7ff:fe1c:9bc4 on br-bd73a564480d.*.
timemachine    | Registering new address record for 172.20.0.1 on br-bd73a564480d.IPv4.
timemachine    | Registering new address record for fe80::42:c1ff:fe8c:95e2 on br-9a3754c0eafd.*.
timemachine    | Registering new address record for 172.21.0.1 on br-9a3754c0eafd.IPv4.
timemachine    | Registering new address record for fe80::42:83ff:fe41:9ab6 on br-853a0bd889a2.*.
timemachine    | Registering new address record for 172.18.0.1 on br-853a0bd889a2.IPv4.
timemachine    | Registering new address record for fdea:89ed:188b:1:8eae:4cff:fedd:6c19 on enx8cae4cdd6c19.*.
timemachine    | Registering new address record for 2603:8080:f800:1357:8eae:4cff:fedd:6c19 on enx8cae4cdd6c19.*.
timemachine    | Registering new address record for 192.168.6.159 on enx8cae4cdd6c19.IPv4.
timemachine    | Registering new address record for ::1 on lo.*.
timemachine    | Registering new address record for 127.0.0.1 on lo.IPv4.
timemachine    | Server startup complete. Host name is frankyclark.local. Local service cookie is 1545633776.
timemachine    | Registering new address record for fd79:6235:218a:4390:8eae:4cff:fedd:6c19 on enx8cae4cdd6c19.*.
timemachine    | Service "frankyclark" (/etc/avahi/services/smbd.service) successfully established.
timemachine    | Withdrawing address record for fd79:6235:218a:4390:8eae:4cff:fedd:6c19 on enx8cae4cdd6c19.
timemachine    | Registering new address record for fd79:6235:218a:4390:8eae:4cff:fedd:6c19 on enx8cae4cdd6c19.*.
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK is now a local master browser for workgroup WORKGROUP on subnet 172.17.0.1
timemachine    |
timemachine    | *****
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK is now a local master browser for workgroup WORKGROUP on subnet 172.18.0.1
timemachine    |
timemachine    | *****
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK is now a local master browser for workgroup WORKGROUP on subnet 172.19.0.1
timemachine    |
timemachine    | *****
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK is now a local master browser for workgroup WORKGROUP on subnet 172.20.0.1
timemachine    |
timemachine    | *****
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK is now a local master browser for workgroup WORKGROUP on subnet 172.21.0.1
timemachine    |
timemachine    | *****
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK is now a local master browser for workgroup WORKGROUP on subnet 192.168.6.159
timemachine    |
timemachine    | *****
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK has stopped being a local master browser for workgroup WORKGROUP on subnet 192.168.6.159
timemachine    |
timemachine    | *****
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK is now a local master browser for workgroup WORKGROUP on subnet 192.168.6.159
timemachine    |
timemachine    | *****
timemachine    | Withdrawing address record for fd79:6235:218a:4390:8eae:4cff:fedd:6c19 on enx8cae4cdd6c19.
timemachine    | process_local_master_announce: Server HPCE81F6 at IP 192.168.4.237 is announcing itself as a local master browser for workgroup WORKGROUP and we think we are master. Forcing election.
timemachine    | *****
timemachine    |
timemachine    | Samba name server FRANKYCLARK has stopped being a local master browser for workgroup WORKGROUP on subnet 192.168.6.159
timemachine    |
timemachine    | *****

Additional Context

No response

mbentley commented 1 year ago

What is the backing filesystem that is used on /dev/sdb? Are there really not any partitions? The only thing I can immediately think of is that samba is incorrectly interpreting the free space due to the filesystem but it's hard to say.

iJasonWade commented 1 year ago

There is only one partition, it is an ext4 format, maybe I should format it again and create a partition?

mbentley commented 1 year ago

Ah! I missed a small but very important detail. You're setting TM_USERNAME=jason which means that your persistent data path is actually /opt/jason in the container. Update your volume from:

- '/home/jason/mnt/timemachine:/opt/timemachine'

to:

- '/home/jason/mnt/timemachine:/opt/jason

Otherwise, it's detecting the amount of free space on the disk where Docker is and it will be storing data inside the container, not on a persistent volume.

mbentley commented 1 year ago

144 from earlier this morning added detection for what filesystems are found in the subdirectories under /opt. I also just added a check in #145 to output a warning message if the detected filesystem is overlay, which it would in most cases where the volume isn't mounted outside.

mbentley commented 1 year ago

Example output:

$ docker run -it --rm -e TM_USERNAME=jason mbentley/timemachine:test
...
INFO: xattr test successful - your persistent data store supports xattrs
WARN: Detected filesystem for /opt/jason is overlay! This likely means that your data is being stored inside the container, not in a volume! See https://github.com/mbentley/docker-timemachine#persistent-data-path
INFO: entrypoint complete; executing 's6-svscan /etc/s6'
...
Service "81cbde81ab4e" (/etc/avahi/services/smbd.service) successfully established.