Announcement

Collapse
No announcement yet.

Backing up to an SSD via a USB port

Collapse
X
 
  • 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:
    Overall:
    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

    Unallocated:
    /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.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    #2
    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:
    Code:
    # 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.
    Code:
    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

    Comment

    Working...
    X