I've successfully used /etc/fstab
to auto mount a usb device located at sdb1
using the following:
/dev/sdb1 /media/Test ntfs-3g defaults,user,exec,uid=1000,gid=100,umask=000 0 0
With this configuration, I've mounted the device having all privileges over its files.
Replace /dev/sdb1
with your device
Replace /media/Test
with your target directory
Replace ntfs-3g
with your USB drive file system
Related reading: Fstab - Community Ubuntu Documentation
My goal was more or less the same as yours, to have an USB drive with an executable file that performs some updates, either on my home PC or my work PC.
Separate the 2 commands. On separate lines or with a ; or with &&. Need to be in a writable directory to run them.
Let's just get and unpack in $HOME dir for now. cd with no args will change to homedir.
cd
wget http://cdimage.ubuntu.com/ubuntu-core/releases/13.04/release/ubuntu-core-13.04-core-armhf.tar.gz
tar -xzf ubuntu-core-13.04-core-armhf.tar.gz
Or:
cd && wget http://cdimage.ubuntu.com/ubuntu-core/releases/13.04/release/ubuntu-core-13.04-core-armhf.tar.gz && tar -xzf ubuntu-core-13.04-core-armhf.tar.gz
Next part of problem. Writing to sdcard mount.
Maybe it is mounted so that only root user can write to it.
So try:
cd /mnt/sdcard
sudo touch TEST # will prompt for your password
ls -al
Do you get an error when you do touch command? Maybe it is not writable by any user if so.
So now if you successfully (hopefully, maybe) can write to /mnt/sdcard do:
cd /mnt/sdcard
sudo wget http://cdimage.ubuntu.com/ubuntu-core/releases/13.04/release/ubuntu-core-13.04-core-armhf.tar.gz
sudo tar -xzf ubuntu-core-13.04-core-armhf.tar.gz
Or better skip the wget if you already did wget in your $HOME dir. Do:
cd /mnt/sdcard
# ~ is shorthand for your $HOME dir
sudo tar -xzf ~/ubuntu-core-13.04-core-armhf.tar.gz
Sorry too detailed but hope you can do that and root can write to sdcard. . . If you get errors please post them and the ls -al result of or in /mnt/sdcard. The mount options can be changed to mount it as writable if needed . . . Will require another part of answer!
Best Answer
Mount OneDrive on Ubuntu
This instruction follows RCLONE - Microsoft OneDrive
1. Download and install Rclone
or download the latest one
2. Add a new OneDrive remote to Rclone
Select the New remote option by entering n and pressing the Enter key:
Enter a name for the new remote, here
onedrive
is used:After pressing the Enter, a list of supported cloud storage services is displayed. You need to select the Microsoft OneDrive option by entering its corresponding number ("16" right now but it may change in the future):
For the next two steps, press Enter without entering any information since there's no need to enter the Microsoft App Client ID or Secret:
Choose the OneDrive account type (enter
b
for Business orp
for Personal OneDrive accounts):Depending on your setup, you'll have to enter auto configuration or manual for the next step. For desktop users, type y to use the auto configuration:
A new tab should open in your default web browser, asking you to give Rclone access to your OneDrive account. Allow it and you can close the tab.
Rclone runs a webserver on your local machine (on port 53682) to retrieve the authentication token. You may need to unblock it temporarily if you use a firewall.
Now you'll need to check if everything is correct and save the settings by typing y:
Exit the Rclone configuration by typing q:
3. Create a new folder
4. Mount OneDrive
You can stop and unmount it by pressing Ctrl + c to close Rclone.
5. (Optional) Mount OneDrive on system startup
To mount OneDrive on startup, open Startup Applications, and in Startup Applications click Add.
After clicking Add, use the following:
There are other ways of mounting OneDrive automatically, like adding a line in your
/etc/fstab file
, using systemd, etc.