Mount U disk on Linux server

Keywords: Linux sudo

1. Check the location of the U disk

sudo fdisk -l

According to the size of the U disk, the approximate path can be roughly determined

My output here is

Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sda: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xfaae6f53

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    976895    974848   476M 83 Linux
/dev/sda2          978942 937701375 936722434 446.7G  5 Extended
/dev/sda5          978944  16977919  15998976   7.6G 82 Linux swap / Solaris
/dev/sda6        16979968 416978943 399998976 190.8G 83 Linux
/dev/sda7       416980992 937701375 520720384 248.3G 83 Linux

Partition 2 does not start on physical sector boundary.


Disk /dev/sdb: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x21d1d4fa

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 937701375 937699328 447.1G 83 Linux


Disk /dev/sdf: 7.3 TiB, 8001529315328 bytes, 15627986944 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9834A7E6-8A30-4C35-AE97-755625E245EF

Device     Start         End     Sectors  Size Type
/dev/sdf1   2048 15627984895 15627982848  7.3T Microsoft basic data

My USB stick is 8T, so it can be roughly judged that the last / dev/sdf1 should be my USB stick

 

2. mount

sudo mount U disk location target location

For example:

sudo mount /dev/sdf1 /braindat/huangwei2

 

3. copy

At this time, the U disk has been successfully mounted on the target location, but the contents of the U disk are not copied on the target machine. At this time, we need to execute cp to copy

But generally, the data is relatively large. If we use cp directly, we will not know how long the replication will take. If there is a progress bar, it is good

Here are two things to introduce:

The first one is tmux. See how to use tmux: A tutorial of using tmux In short, tmux is a small plug-in that divides screens and opens multiple terminals. Sometimes, on the server, we need to open multiple terminals on the same path at the same time and switch them. This requires tmux. tmux new means to create a new terminal, first press Ctrl+B, then press D to temporarily exit the terminal, etc

The second is mc. The first is installation: sudo apt get install mc. Use the tutorial: mc tutorial

Copy window:

Posted by execute on Tue, 26 Nov 2019 13:43:40 -0800