Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unix Sync Time - Unix
#1
Quote:sudo date -s "$(wget --method=HEAD -qSO- --max-redirect=0 google.com 2>&1 | sed -n 's/^ *Date: *//p')"
Reply
#2
How to Copy Linux Folders to a Windows USB Drive

If you've ever tried copying files from a Linux server to an external drive (formatted as NTFS or exFAT) using rsync, you likely ran into a wall of "Operation not permitted" errors. This is because Windows filesystems don't support Linux file permissions or symbolic links.



1. Mount Your Drive
First, create a mount point and connect your drive. (Note: Verify your device identifier with sudo fdisk -l, as it may change depending on your setup.)

Code:
sudo mkdir -p /media/usb
sudo mount /dev/sdc1 /media/usb

2. The "Safe Copy" Command
Use this command to bypass permission errors and convert shortcuts (symlinks) into real files:

Code:
sudo rsync -ahL --progress --no-owner --no-group --no-perms /home/me/nb/ra /media/usb/

Why these flags?
  • -a (Archive): Preserves modification times.
  • -h (Human-readable): Shows progress in KBs/MBs.
  • -L (Follow Symlinks): Crucial for projects containing node_modules; it copies the actual file instead of the shortcut.
  • --no-owner / --no-group / --no-perms: Prevents rsync from trying to set Linux permissions that a Windows drive will reject.

3. Safely Unmount
Always flush the data buffers and unmount before unplugging to prevent data corruption:

Code:
sync
sudo umount /media/usb

https://www.forum4hk.com
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)