Commands and safe workflow for a lay-flat USB-to-SATA dock (2.5" SSD / 3.5" HDD). Built for C&C BME.
/dev/sdX) before mounting or copying.dd, wipefs, mkfs, parted, sgdisk can destroy data instantly if you pick the wrong disk.
After you power the dock and insert the drive, run:
lsusb dmesg -T | tail -n 60 lsblk -o NAME,SIZE,TYPE,FSTYPE,LABEL,UUID,MOUNTPOINTS,MODEL,SERIAL
lsblk is your best friend. Look for a new device like /dev/sdb with partitions like /dev/sdb1, /dev/sdb2, etc.
sudo fdisk -l /dev/sdX sudo blkid /dev/sdX*
Replace sdX with the correct device (example: sdb).
sudo mkdir -p /mnt/dock
sudo mount /dev/sdX1 /mnt/dock
sudo mount -o ro /dev/sdX1 /mnt/dock
You may need filesystem helpers installed (especially for Windows drives).
# Common helpers (availability can vary by Alma version/repos) sudo dnf install -y ntfs-3g exfatprogs
dnf can’t find a package, don’t force it—tell Clarus what Alma version you’re on and the exact error output.
df -hT | grep -E '/mnt/dock|Filesystem' mount | grep /mnt/dock
# Copy everything to a local folder (preserve times/permissions where possible) sudo mkdir -p /data/recovery sudo rsync -aHAX --info=progress2 /mnt/dock/ /data/recovery/
sudo rsync -a --no-perms --no-owner --no-group --info=progress2 /mnt/dock/ /data/recovery/
find /mnt/dock -type f | wc -l find /data/recovery -type f | wc -l
For SSD/HDD health (SMART), install tools and query:
sudo dnf install -y smartmontools sudo smartctl -a /dev/sdX
sudo umount /mnt/dock
sudo lsof +f -- /mnt/dock sudo fuser -vm /mnt/dock
Close programs using the mount, then try umount again.
sync
# Shows block devices and whether they are removable lsblk -o NAME,RM,SIZE,MODEL,MOUNTPOINTS
umount + sync, it’s safe to power off the dock and remove the drive.
If you want a disk image (careful: requires lots of space):
sudo dnf install -y gddrescue # Example: image the entire disk to a file (needs large destination space) sudo mkdir -p /data/images sudo ddrescue -f -n /dev/sdX /data/images/disk.img /data/images/disk.log # Optional retry pass (can take a long time) sudo ddrescue -d -f -r3 /dev/sdX /data/images/disk.img /data/images/disk.log
/dev/sdX is the SOURCE and the .img file is the DESTINATION.