No announcement yet.

Backing up to an SSD via a USB port

  • Filter
  • Time
  • Show
Clear All
new posts

    Backing up to an SSD via a USB port

    A couple of things I learned tonight.
    I took the second SSD from my old Acer and put it in a USB HDCaddy. I plugged the caddy into my passive 4 port USB hub.
    I have 5 snapshots on my ROOTFS, along with my entire KDE Neon system. Combined they took about 88 GiB.
    My system:
    $ sudo btrfs filesystem usage /
    [sudo] password for jerry:
    Device size: 441.04GiB
    Device allocated: 108.02GiB
    Device unallocated: 333.02GiB
    Device missing: 0.00B
    Used: 88.00GiB
    Free (estimated): 352.14GiB (min: 352.14GiB)
    Data ratio: 1.00
    Metadata ratio: 1.00
    Global reserve: 163.09MiB (used: 0.00B)

    Data,single: Size:106.01GiB, Used:86.88GiB (81.96%)
    /dev/sda3 106.01GiB

    Metadata,single: Size:2.01GiB, Used:1.11GiB (55.38%)
    /dev/sda3 2.01GiB

    System,single: Size:4.00MiB, Used:16.00KiB (0.39%)
    /dev/sda3 4.00MiB

    /dev/sda3 333.02GiB
    I expected the caddy to hold a dozen or two snapshots because it contains a Samsung 860 EVO 500 GB SSD. BUT, it ran out of space during the transfer of the 5th snapshot I sent to it. It had been freshly formatted and nothing was on it when I began the first transfer.
    I didn't see that coming.
    Another thing I didn't see coming was that fstrim does not work on SSD's if they are connected via a USB port.
    "I would rather have questions that can't be answered, than answers that can't be questioned." ― Richard Feynman

    I found out that the way to fstrim an SSD connected via usb is to include a udev rule for the usb device. I use a USB3 to SATA adapter cable to hook up a Samsung SATA SSD to boot and run my Raspberry Pi. To get fstrim to work I had to add the following /etc/udev/rules.d/01-asmedia-trim.rules file:
    # ASMedia ASM1153E controller (Eluteng adapters)
    ACTION=="add|change", ATTRS{idVendor}=="174c", ATTRS{idProduct}=="55aa", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
    I got the device specific information from a lsusb command.
    Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s
    bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge
    At that point all I had to do was make sure fstrim.timer was enabled and running