Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tutorial on mounting OneDrive, Google Drive and other network disks (Linux) with Rclone

 

Preface

Rclone is a command-line tool that supports synchronization, uploading, and downloading data between different object storage and network disks . And through some settings, very practical functions such as offline downloading and server backup can be realized. There are many ways to use Rclone, and mounting is one of them.

Friendly reminder: Mounting this operation is not necessary. As an experimental feature, it has many limitations and problems. After mounting, it cannot be used as a real disk. When performing file operations, the local disk will be used for caching, which takes up local disk space. Improper use may also cause problems such as disk fullness and VPS freezing. Search "Rclone" on Google, and the most related keyword is "mount", which to a certain extent is misleading to many new friends. To perform uploading, downloading, synchronization and other operations stably, it is recommended to use Rclone's native command function. For usage methods, please refer to " Rclone Advanced Usage Tutorial - Common Command Parameters ".The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

Install and configure Rclone

The official one-click installation script is provided:The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

< span class = "token function" > curl < /span > https ://rclone.org/install.sh <span class="token operator">|</span> <span class="token function">sudo< /span> <span class="token function">bash</span>The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

After installation, enter  rclone config the command to enter the interactive configuration option and follow the prompts step by step. If you are confused, you can read the "Rclone Installation and Configuration Tutorial " to understand the detailed configuration process.The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

Install fuse

Mounting requires fuse to be installed. Choose the installation command according to your system:The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

< span class = "token comment" ># Debian/Ubantu</span>The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

< span class = "token function" > apt-get < /span > update < span class = "token operator" > && < /span > < span class = "token function" > apt-get < /span > < span class = "token function" > install < /span > -y fuseThe article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

< span class = "token comment" ># CentOS</span>The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

yum < span class = "token function" > install < /span > -y fuseThe article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

Mount network disk

Mounting the network disk is divided into manual mounting and automatic mounting at startup. You can choose according to your own needs.The article originates fromSinsTu NI-https://www.sinstu.com/archives/44.html

Manual mounting

< span class = "token comment" >#Mount</span>

rclone < span class = "token function" > mount < /span > < span class = "token operator" ><< /span > Network disk name: Network disk path < span class = "token operator" >>< /span > < span class = "token operator" ><< /span > Local path < span class = "token operator" >>< /span > < span class = "token punctuation" >[< /span > Parameters < span class = " token punctuation" >]< /span > --daemon

< span class = "token comment" >#Cancel mounting</span>

fusermount -qzu < span class = "token operator" ><< /span > Local path < span class = "token operator" >>< /span >

网盘名称It is filled in during configuration  nameand 网盘路径is a folder in the network disk. Leave blank to represent the entire network disk and 本地路径a local folder on the VPS. 参数You can check the official documentation to make a selection based on your needs. Do not use parentheses when typing, this is just to make the distinction clearer. --daemon It is a process daemon parameter and can be run in the background.

Usage example

Enter the command to mount:

rclone < span class = "token function" > mount < /span > Onedrive:/ /Onedrive --copy-links --allow-other --allow-non-empty --umask 000 --daemon

Then enter  df -h the command to check the mounting status.

root@P3TERX:~ < span class = "token comment" ># df -h</span>

Filesystem Size Used Avail Use% Mounted on

udev 286M < span class = "token number" > 0 < /span > 286M < span class = "token number" > 0 < /span > % /dev

tmpfs 60M < span class = "token number" > 7 < /span > .8 M 52M < span class = "token number" > 14 < /span > % /run

/dev/sda1 99G 25G 71G < span class = "token number" > 26 < /span > % /

tmpfs 297M 24K 297M < span class = "token number" > 1 < /span > % /dev/shm

tmpfs < span class = "token number" > 5 < /span > .0 M < span class = "token number" > 0 < /span > < span class = "token number" > 5 < /span > .0 M < span class = "token number" > 0 < /span > % /run/lock

tmpfs 297M < span class = "token number" > 0 < /span > 297M < span class = "token number" > 0 < /span > % /sys/fs/cgroup

Onedrive: < span class = "token number" > 5 < /span > .0 T 216G < span class = "token number" > 4 ​​< /span > .8 T < span class = "token number" > 5 < /span > % /Onedrive < span class = "token comment" >#This is the mounted network disk</span>

Unmount:

fusermount -qzu /Onedrive

Automatically mount on boot

  • Download and edit the autostart script

< span class = "token function" > wget < /span > -N git.io / rcloned < span class = "token operator" > && < /span > < span class = "token function" > nano < /span > rcloned

  • Modification content:

NAME= "Onedrive" #The name filled in during Rclone configuration

REMOTE= '' #Remote folder, a folder mounted in the network disk, leave it blank for the entire network disk

LOCAL= '/Onedrive' #Mount address, VPS local mounting directory

  • Set up auto-start at power on

< span class = "token function" > mv < /span > rcloned /etc/init. d /rcloned

< span class = "token function" > chmod < /span > +x /etc/init. d /rcloned

update-rc. d -f rcloned defaults < span class = "token comment" ># Debian/Ubuntu</span>

< span class = "token function" > chkconfig < /span > rcloned on < span class = "token comment" ># CentOS</span>

< span class = "token function" > bash < /span > /etc/init. d /rcloned start

Just see it  [信息] rclone 启动成功 ! .

manage

Start mounting bash /etc/init.d/rcloned start

Stop mounting bash /etc/init.d/rcloned stop

Remount bash /etc/init.d/rcloned restart

View log tail -f /$HOME/.rclone/rcloned.log

Uninstall self-starting mount

bash /etc/init. d /rcloned stop

update-rc. d -f rcloned remove # Debian/Ubuntu

chkconfig rcloned off # CentOS

rm -f /etc/init. d /rcloned

References

rclone official documentation

Use rclone to mount OneDrive network disk on Debian/Ubuntu

How to enable TCP BBR2 network congestion control on Windows 11

 Generally, when we use the Linux series operating system, we will install Google's BBR network congestion control software. BBR v2 version can now be enabled on Windows 11.

BBRv2 is a model-based congestion control algorithm designed for reduced queuing, low loss, and (bounded) Reno/CUBIC coexistence. Maintains a model network path using measurements of bandwidth and RTT, and (if occurring) packet loss and/or DCTCP/L4S style ECN signaling.

BBR2 is more "fair" than BBR. In the case of delay and packet loss, its speed will be much slower than BBR, and sometimes slower than the default CUBIC, so you have to test it according to your own link. It can only be regarded as something that is better than nothing.

Windows Server now uses the CUBIC congestion control algorithm by default, which is currently the most commonly used congestion control algorithm.

This article directory

  • 1. Related Links
  • 2. Operation steps
    • 2.1. Windows 11
    • 2.2. Linux
  • 3. Restore settings

Related Links

Google BBR GitHub: https://github.com/google/bbr

Introduction to TCP BBR v2 Alpha/Preview

Steps

Windows 11

The requirement Windows 11is 22h2version and above.

1. Open powershell and right-click to run with administrator privileges

netsh int tcp set supplemental Template=Internet CongestionProvider=bbr2
netsh int tcp set supplemental Template=Datacenter CongestionProvider=bbr2
netsh int tcp set supplemental Template=Compat CongestionProvider=bbr2
netsh int tcp set supplemental Template=DatacenterCustom CongestionProvider=bbr2
netsh int tcp set supplemental Template=InternetCustom CongestionProvider=bbr2

2. Verify whether it is successfully opened

Get-NetTCPSetting | Select SettingName, CongestionProvider
Picture[1]-How to enable TCP BBR2 network congestion control on Windows 11-Ritz Miscellaneous

Linux

View the current congestion control algorithm

sysctl net.ipv4.tcp_congestion_control

If the output is sysctl net.ipv4.tcp_congestion_controlsomething like that, it means our current algorithm is CUBIC and we edited /etc/sysctl.confto change it to BBR.

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

save and apply

sysctl -p

Checking again we will see

net.ipv4.tcp_congestion_control = bbr

The above shows that net.ipv4.tcpit can actually be used in IPv6.

restore settings

Sometimes unexpected problems may occur after opening.

We can enter the following command in powershell to restore.

netsh int tcp set supplemental template=internet congestionprovider=CUBIC
netsh int tcp set supplemental template=internetcustom congestionprovider=CUBIC
netsh int tcp set supplemental template=Datacenter congestionprovider=CUBIC
netsh int tcp set supplemental template=Datacentercustom congestionprovider=CUBIC

Test script bench.sh (for network and IO tests of various Linux distributions)

 After several versions of iterations, the one-key test script bench.sh is almost applicable to the network and IO tests of various Linux distributions.

And display the test results in a more beautiful way.

Summarize the features of bench.sh:

1. Display various system information;
2. Test points taken from Speedtest data centers in many parts of the world, and the network test is relatively comprehensive;
3. Support IPv6 download speed measurement;
4. IO test (write 1GB data sequentially) three times, and display the average value.

Combined with the  unixbench.sh  script test, you can fully test the performance of the VPS.

How to use:
Command 1:

wget -qO-bench.sh | bash

or

curl -Lso-bench.sh | bash

Command 2:

wget -qO-86.re /bench.sh | bash _ _

or

curl -so-86.re /bench.sh | bash _ _

Note:
bench.sh is both the script name and the domain name. So don't suspect that I wrote it wrong or you read it wrong.

Download address:
https://github.com/teddysun/across/blob/master/bench.sh

update log

Updated on February 22, 2022:
1. Added the judgment of whether the CPU supports AES-NI and VM-x/AMD-V;
2. Improved the algorithm for calculating hard disk space;
3. Improved the algorithm for calculating RAM and Swap;
4. Improve the time stamp display method and add time zone display;

Picture [1] - test script bench.sh (applicable to network and IO tests of various Linux distributions) - Rich Miscellaneous


Updated on January 1, 2022:
1. Optimized the script logic and beautified the display;
2. Upgraded the version of speedtest-cli to 1.1.1;
3. Supported arm64 (aarch64) and armv7l (armhf) architectures, as shown in the figure below;
・arm64 (aarch64)

Picture [2] - test script bench.sh (suitable for network and IO tests of various Linux distributions) - Rich Miscellaneous


・armv7l (armhf)

Picture [3] - test script bench.sh (suitable for network and IO tests of various Linux distributions) - Rich Miscellaneous


4. Optimize the speed test server list provided by Speedtest. Among them, the node information of Shanghai, Nanjing and Guangzhou in China is as follows

24447 ) China Unicom 5G ( ShangHai, China )< font >< /font >
26352 ) China Telecom JiangSu 5G ( Nanjing, China )< font >< /font >
27594 ) ChinaTelecom 5G ( Guangzhou, China )

・x86_64

Picture [4] - test script bench.sh (suitable for network and IO tests of various Linux distributions) - Rich Miscellaneous

Updated on July 29, 2020:
1. Modification: Speedtest is provided by Speedtest, which distinguishes between upload and download, which is more practical;
2. Added: TCP Congestion Control; virtualization method; IP information, etc.

The figure below shows my  Vultr  evaluation data:

Picture [5] - test script bench.sh (applicable to network and IO tests of various Linux distributions) - Rich Miscellaneous

Update on January 07, 2018:
Modification: The color of the displayed information is divided into categories to make it easier to distinguish.

The figure below shows the evaluation data of my KS3C 100M dedicated server:

Picture [6] - test script bench.sh (suitable for network and IO tests of various Linux distributions) - Rich Miscellaneous

Updated on November 24, 2016:
Added: display hard disk information; advance the location of the IO speed test, and put the network download speed test at the end.

As follows:

Picture [7] - test script bench.sh (suitable for network and IO tests of various Linux distributions) - Rich Miscellaneous

Put some test pictures at the end.

Bandwagon Host Los Angel

Picture [8] - test script bench.sh (suitable for network and IO testing of various Linux distributions) - Rich Miscellaneous

DigitalOcean Singapore

Picture [9] - test script bench.sh (suitable for network and IO testing of various Linux distributions) - Rich Miscellaneous

Ramnode Seattle

Picture [10] - test script bench.sh (applicable to network and IO tests of various Linux distributions) - Rich Miscellaneous

Xvmlabs Los Angel

Picture [11] - test script bench.sh (suitable for network and IO tests of various Linux distributions) - Rich Miscellaneous

Reprinted: Qiushui Yibing  »  One-click test script bench.sh