Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
David C.118
9 years agoExplorer | Level 4
Dual booting with shared DB drive possible?
I am looking in to buying a new laptop and will need to dual boot Windows and Ubuntu. I am planning three SSD's - one for Windows, one for Ubuntu and one as a shared data drive. Is it possible to...
- 9 years ago
It's very possible, just not supported or recommended.
Install Dropbox and use the Advanced Options to specify the location for your Dropbox folder. Allow it to sync completely. Boot into the other operating system and install Dropbox, again using Advanced Options to specify the same Dropbox folder. Dropbox will index your files when the installation is complete, but shouldn't need to sync anything unless there have been changes (though it may appear to be syncing, just let it work).
It is extremely important that you DO NOT USE SELECTIVE SYNC from either operating system when running in this configuration. If you do, you WILL lose files.
I would also suggest never booting into the other operating system until you're certain that the current one is fully synced. Also, as always, keep your own backups of your data.
Здравко
7 years agoLegendary | Level 20
TripleS, Sorry, my last publication was one of my drafts. For sure it will not work. It was debug version (some syntax error was still there, missing punctuation). After install I didn't use it for long time (multiple versions was on same place). The next is the last actual version:
#!/bin/bash
##############################################################################
# Workaround for Dropbox daemon
# -----------------------------
# Verified on Dropbox v73.4.118
# Just make it executable (if need, using
# $ chmod a+x fix_dropbox
# ) and run it.
# Author: Здравко
# www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790
##############################################################################
# Figure out the target places.
USR_HOME=`realpath ~`
USR_LOCAL="$USR_HOME/.local"
USR_LOCAL_BIN="$USR_LOCAL/bin"
USR_LOCAL_LIB="$USR_LOCAL/lib"
DRB_REPLACEMENT="$USR_LOCAL_BIN/dropbox"
DRB_FIX_LIB="$USR_LOCAL_LIB/libdropbox_ext4.so"
USR_PROFILE="$USR_HOME/.profile"
##############################################################################
# Precheck and fix up some prerequisites.
# Ensure target directories are on their place.
if [[ ! -d $USR_LOCAL_BIN ]]
then
echo "The Directory \"$USR_LOCAL_BIN\" doesn't exist, going to create it."
mkdir -p $USR_LOCAL_BIN
if [[ $? -ne 0 || ! -d $USR_LOCAL_BIN ]]
then
echo "Directory \"$USR_LOCAL_BIN\" creation fail! Exit."
exit 1
fi
fi
if [[ ! -d $USR_LOCAL_LIB ]]
then
echo "The Directory \"$USR_LOCAL_LIB\" doesn't exist, going to create it."
mkdir -p $USR_LOCAL_LIB
if [[ $? -ne 0 || ! -d $USR_LOCAL_LIB ]]
then
echo "Directory \"$USR_LOCAL_LIB\" creation fail! Exit."
exit 1
fi
fi
# Ensure backup for any existing files.
if [[ -e $DRB_REPLACEMENT ]]
then
if [[ -f $DRB_REPLACEMENT ]]
then
echo "\"$DRB_REPLACEMENT\" already exist, going to back it up."
mv --backup=t -T $DRB_REPLACEMENT "${DRB_REPLACEMENT}.backup"
if [[ $? -ne 0 || -e $DRB_REPLACEMENT ]]
then
echo "Error backing up \"$DRB_REPLACEMENT\" file! Exit."
exit 1
fi
else
echo "$DRB_REPLACEMENT is not regular file! Exit."
exit 1
fi
fi
if [[ -e $DRB_FIX_LIB ]]
then
if [[ -f $DRB_FIX_LIB ]]
then
echo "\"$DRB_FIX_LIB\" already exist, going to back it up."
mv --backup=t -T $DRB_FIX_LIB "${DRB_FIX_LIB}.backup"
if [[ $? -ne 0 || -e $DRB_FIX_LIB ]]
then
echo "Error backing up \"$DRB_FIX_LIB\" file! Exit."
exit 1
fi
else
echo "$DRB_FIX_LIB is not regular file! Exit."
exit 1
fi
fi
# Ensure writing permissions.
if [[ ! -w $USR_LOCAL_BIN || ! -x $USR_LOCAL_BIN ]]
then
chmod u+rwx $USR_LOCAL_BIN
if [[ $? -ne 0 ]]
then
echo "The Directory \"$USR_LOCAL_BIN\" is inaccessible! Exit."
exit 1
fi
fi
if [[ ! -w $USR_LOCAL_LIB || ! -x $USR_LOCAL_LIB ]]
then
chmod u+rwx $USR_LOCAL_LIB
if [[ $? -ne 0 ]]
then
echo "The Directory \"$USR_LOCAL_LIB\" is inaccessible! Exit."
exit 1
fi
fi
##############################################################################
# Generate actual workaround components.
# Fixer - source and building.
gcc -shared -fPIC -ldl -xc -o $DRB_FIX_LIB - << EndOfSrc
// Functions replacements
#define _GNU_SOURCE
#include <stdlib.h>
#include <sys/vfs.h>
#include <linux/magic.h>
#include <dlfcn.h>
#include <sys/statvfs.h>
#include <stdarg.h>
static int (*orig_statfs)(const char *path, struct statfs *buf) = NULL;
static int (*orig_statfs64)(const char *path, struct statfs64 *buf) = NULL;
static int (*orig_open64)(const char *pathname, int flags, ...) = NULL;
int statfs(const char *path, struct statfs *buf) {
if (orig_statfs == NULL) {
orig_statfs = dlsym(RTLD_NEXT, "statfs");
}
register int retval = orig_statfs(path, buf);
if (retval == 0) {
buf->f_type = EXT4_SUPER_MAGIC;
}
return retval;
}
int statfs64(const char *path, struct statfs64 *buf) {
if (orig_statfs64 == NULL) {
orig_statfs64 = dlsym(RTLD_NEXT, "statfs64");
}
register int retval = orig_statfs64(path, buf);
if (retval == 0) {
buf->f_type = EXT4_SUPER_MAGIC;
}
return retval;
}
int open64(const char *pathname, int flags, ...) {
if (orig_open64 == NULL) {
orig_open64 = dlsym(RTLD_NEXT, "open64");
}
register const char *p0 = "/proc/filesystems", *p1 = pathname;
while(*p0 && *p1 && *p0 == *p1) ++p0, ++p1;
if (*p0 == '\0' && *p1 == '\0') {
return -1;
}
va_list arg;
va_start(arg, flags);
mode_t mode = va_arg (arg, int);
va_end(arg);
return orig_open64(pathname, flags, mode);
}
EndOfSrc
if [[ $? -ne 0 ]]
then
echo "Error building \"$DRB_FIX_LIB\"! Exit."
exit 2
fi
echo "\"$DRB_FIX_LIB\" - build and ready."
# Wrapper generating.
cat > $DRB_REPLACEMENT << WrapperHead
#!/bin/bash
if [ \$1 == "start" ]
then
sleep 1
patchpath=\`which \$0\`
if echo \$(for i in \`ps -C dropbox -o pid\`
do ls -l /proc/\$i/exe 2>/dev/null | grep -v \$patchpath
done) | grep dropbox > /dev/null
then
timeout=300
# Make sure there isn't any concurrent start operation in progress.
/usr/bin/dropbox running
while [[ \$? -eq 0 && \$timeout -ne 0 ]]
do
sleep 1
((--timeout))
if echo \$(for i in \`ps -C dropbox -o pid\`
do ls -l /proc/\$i/exe 2>/dev/null | grep -v \$patchpath
done) | grep dropbox > /dev/null
then
/usr/bin/dropbox running
fi
done
# If there is running application instance, force its stop.
/usr/bin/dropbox running
while [[ \$? -ne 0 && \$timeout -ne 0 ]]
do
/usr/bin/dropbox stop
sleep 1
((--timeout))
/usr/bin/dropbox running
done
# If something goes wrong...
if [[ \$timeout -eq 0 ]]
then
# ...notify somehow about.
title="Problem launching Dropbox"
mainmsg="Possible existing application instance dead"
submsg="Check that, clear and try start again"
if which notify-send > /dev/null
then notify-send --icon=dropbox "\$title" "<b>\$mainmsg\!</b>\n\$submsg."
elif which zenity > /dev/null
then zenity --error --title="\$title" --timeout=10 --width=380 \\
--text="<span size=\"xx-large\"><b>\$mainmsg\!</b>\n\$submsg.</span>" \\
2> /dev/null
else echo " \$title!"
echo "\$mainmsg."
echo "\$submsg."
fi
exit 1
fi
fi
fi
WrapperHead
declare -p | grep "declare -x LD_PRELOAD" > /dev/null
if [[ $? -ne 0 ]]
then
echo "export LD_PRELOAD=$DRB_FIX_LIB" >> $DRB_REPLACEMENT
else
echo "LD_PRELOAD=$DRB_FIX_LIB:\$LD_PRELOAD" >> $DRB_REPLACEMENT
fi
echo "/usr/bin/dropbox \$@" >> $DRB_REPLACEMENT
chmod a+x $DRB_REPLACEMENT
echo "\"$DRB_REPLACEMENT\" - generated."
# Environment check and fixup (if need).
echo ""
echo ""
(
IFS=:
for a in $PATH
do
if [[ "$a" == "$USR_LOCAL_BIN" ]]
then
exit 0
elif [[ "$a" == "/usr/bin" ]]
then
break
fi
done
exit 1
)
if [[ $? -ne 0 ]]
then
echo "" >> $USR_PROFILE
echo "" >> $USR_PROFILE
echo "# Add $USR_LOCAL_BIN to \$PATH environment variable." >> $USR_PROFILE
echo "# This addition is dedicated for Dropbox Workaround." >> $USR_PROFILE
echo "# Remove theses lines when they are no more needed." >> $USR_PROFILE
echo "PATH=\"$USR_LOCAL_BIN:\$PATH\"" >> $USR_PROFILE
echo "" >> $USR_PROFILE
echo "Your Dropbox is almost patched. You have to logout and login"
echo " (or on Your opinion - restart), so all changes to take effect."
echo "After Your next account login:"
fi
echo "Your Dropbox is already patched. Just start it from desktop GUI or type:"
echo "\$ dropbox start"
echo "in console."paloi
7 years agoExplorer | Level 4
Здравко Thanks for your posting, it looks like a new hope after so many months.
Could you please confirm what the script does?
Not only the workarround to have the Dropbox only once over the NTFS locations, but also a single DB which avoids reindexing every time one boots with the other OS, plus support for selective sync?
- Здравко7 years agoLegendary | Level 20
Hi paloi, Yes, I reinstall it just to be sure (after detecting that the last publication wasn't the recent). Exact function is: mask the underlying filesystem, so for Dropbox it looks like Ext4 (doesn't matter what is realy). The change is only how it looks like, there are no any actual changes in real filesystem.
- Здравко7 years agoLegendary | Level 20
I don't use selective sync, so this is not tested.
About Create, upload, and share
Find help to solve issues with creating, uploading, and sharing files and folders in Dropbox. Get support and advice from the Dropbox Community.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!