Attach a disk to a Linux instance

Source: Internet
Author: User

1. Sometimes the system cannot mount the NTFS disk in windows, and you need to manually mount the disk and write a simple script:

If you do not know your disk number, enter the following command:

 
Ls/dev/SDA *

In this case, we can see SDA, sda1, sda2, sda5, and sda6, among which the primary partition is used before ID 4, and the logical partition is used after Id 4.

You can also run the following command to view the details of each disk,

 
DF-H

Then you can mount it with the following script (note that you can modify the executable permission ):

 #  ! /Bin/bash  
Echo " Start working "

# Create a folder for future mounting
Sudo Mkdir /Mnt/win_c/mnt/win_d # /Mnt/win_e/mnt/win_f

# Sda1, 50 GB, drive C
Sudo Mount-t ntfs/dev/sda1/mnt/win_c

# Sda2, do not know what disk is, do not attach
# Sudo Mount-t ntfs/dev/sda2/mnt/win_e

# Sda5, 600 GB, d Disk
Sudo Mount-t ntfs/dev/sda5/mnt/win_d

# Sda6, 234 GB, e disk, that is, deepin installation disk, NO content, no need to attach
# Sudo Mount-t ntfs/dev/sda6/mnt/win_f

Echo " Success, now begin visiting windows in/dev/win * "

Ii. mount a USB flash drive

I like playing with the system. I often don't know the graphic interface, but I want to save small batches of data on the desktop. What should I do? Then you can enter the reply mode. after entering the console, manually mount the USB flash disk and copy the desktop file to the USB flash drive!

 
Mkdir/Mnt/USB
Sudo Mount/dev/sdb1/mnt/USB

Generally, the disk Number of the USB flash drive is SDB, sdb1, and so on. You can check the disk number by ls.
If you want to save a large amount of data, either Windows or Linux, you can use Linux livecd to start the disk. The graphic interface is available. You can copy data from an external hard disk!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.