Last active
January 1, 2020 06:20
-
-
Save hivivo/36438efb0b332dcd1ef33054c139bfe8 to your computer and use it in GitHub Desktop.
linux devices and sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to detach a busy device immediately | |
umount -l /PATH/OF/BUSY-DEVICE | |
umount -f /PATH/OF/BUSY-NFS(NETWORK-FILE-SYSTEM) | |
# locate/identify the busy the process | |
lsof | grep '/dev/sda1' | |
pkill target_process | |
umount /dev/sda1 | |
# kill any processes accessing file | |
fuser -kim /address | |
unmount /address | |
# sync two folders | |
# -a Do the sync preserving all filesystem attributes | |
# -v run verbosely | |
# -u skip files that are newer on the receiver | |
# --delete delete the files in target folder that do not exist in the source, /home/user/A: source folder, /home/user/B: target folder | |
rsync -avu --delete "/home/user/A" "/home/user/B" | |
# format partition | |
sudo mkfs.ext4 /dev/sdaX | |
# check attached devices | |
lsblk | |
lsblk --fs | |
# remove all metadata from mp4 file | |
ffmpeg -i test.mp4 -map_metadata -1 -c:v copy -c:a copy out.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment