Tag Info

New answers tagged

0

You can try this: copy all the files to a new partition, making sure that the contents of /usr do not change while you are doing this. edit /etc/fstab so that /usr will be mounted on the next reboot reboot delete the old files Copy files: I would use cp -a. -a is the archive option. From the man page: -a, --archive same as -dR ...


1

It sounds to me like you are trying to mount directories which are already mounted (or part of a mount) to a different location. The way to do is is to mount -o bind. So you would have something like this: UUID=XXX-Data-drive-UUID-XXX /media/data ext4 defaults 0 1 /media/data/tmp /tmp ext4 defaults,bind 0 0 /media/data/home /home ext4 defaults,bind 0 0 ...


0

You can try using --bind option: UUID=XXX-Data-drive-UUID-XXX /media/data ext4 default 0 1 /media/data/tmp /tmp none defaults,bind 0 0 /media/data/home /home none defaults,bind 0 0 /media/data/usr /usr none defaults,bind 0 0 /media/data/var /var none defaults,bind 0 0


1

I wanted to preserve my symlinks as symlinks. For that you can use the -l option. -l, --links copy symlinks as symlinks Since I was copying frameworks on OS X, I found this helpful.


1

Rename the rules file to: /etc/udev/rules.d/99-sdcard.rules , possibly some rules are required to run before it.


2

/bin is probably a symlink to /usr/bin on your system. If that were true then: /bin/../sfw/bin/zsh would actually be the same as /usr/bin/../sfw/bin/zsh which reduces to /usr/sfw/bin/zsh which is where zsh actually lives. Note that what you tried, which was /bin/sfw/bin does not correspond to any path that you actually could see on the system. ...


0

The other answers here were fine but were insufficient for my needs. I needed a solution that I could use in my scripts on any machine. My solution was to write a shell script which I can invoke from the scripts where I need it. #!/bin/sh if [ $# -eq 0 ] || [ $# -gt 2 ]; then printf 'Usage: respath path [working-directory]\n' >&2 exit 1 fi ...


0

#!/bin/bash copy_file_and_dependencies() { PROGRAM="$1" DEPENDENCIES="$(ldd "$PROGRAM" | awk '{ print $3 }' | grep -v '(' | grep -v 'not a dynamic executable')" mkdir -p "${JAIL}$(dirname $PROGRAM)" cp -Lv "$PROGRAM" "${JAIL}${PROGRAM}" for f in $DEPENDENCIES; do mkdir -p "${JAIL}$(dirname $f)" cp -Lv "$f" "${JAIL}${f}" ...


0

So, the answer given by arnefm (that's been copied all over the internet) does not deal with spaces in file names. I've written a script that deals with spaces in files. #!/bin/bash fdupes -r -1 CHANGE_THIS_PATH | sed -e 's/\(\w\) /\1|/g' -e 's/|$//' > files while read line; do IFS='|' read -a arr <<< "$line" orig=${arr[0]} ...



Top 50 recent answers are included