How to mount Media to home in Ubuntu

Source: Internet
Author: User
Tags file permissions

First installed the Win7 system, and then installed an Ubuntu system, because in the installation of Ubuntu, the system partition is not good, resulting in the majority of the hard disk is divided into the Win7 system.

However, commonly used is the Ubuntu system, the entire hard disk 2T, but Ubuntu home want $250GB, with the use of space is not enough. The rest of the space is divided into cdef disks by the Win7 system.

Now you need to pull Android code compilation in Ubuntu. There are only two ways to do this:

Method One: Re-install the system

Method Two: Format the plates inside the Win7 and mount them to the Ubuntu home directory.

Here's a second way to talk about it.


1. Format the disk:

Use the DF command to view current system disk conditions, such as now you want to format sdb7

A. Use command: sudo mkfs-t ext3/dev/sdb7

It takes time to wait, if the progress starts after execution and is being executed.

The final display is as follows:

mke2fs 1.41.14  (22-dec-2010)    filesystem label=   os type: linux    block size=4096  (log=2)    fragment size=4096  (log=2)    stride=0 blocks, stripe width=0 blocks   12804096 inodes, 51199147  blocks   2559957 blocks  (5.00%)  reserved for the super user    first data block=0   maximum filesystem blocks=0   1563  block groups   32768 blocks per group, 32768 fragments per  group   8192 inodes per group   superblock backups stored  on blocks:        32768, 98304, 163840, 229376,  294912, 819200, 884736, 1605632, 2654208,         4096000, 7962624, 11239424, 20480000, 23887872      Writing inode tables: done                                 creating journal  (32768  blocks): done   writing superblocks and filesystem accounting  information: done      this filesystem will be automatically  checked every 36 mounts or   180 days, whichever comes first.   use tune2fs -c or -i to override.  

is a sign of success.

The b.sdb7 is viewed with the DF command, listing the list of mounted devices.

If you execute a, the following prompt appears: Mke2fs 1.41.14 (22-dec-2010)/dev/sdb1 is mounted; Won't make a filesystem here!

Indicates that the disk is mounted and needs to be mounted:

Execute command:

sudo umount/dev/sdb7

Note: It's umount, not unmount!

Execute this command and then execute a.

C. The disk cannot be mounted directly under the home, but can only be mounted to the MNT:

Execute the command to mount under/MNT:

sudo mkdir-p/mnt/dir
This command is to create a new directory named Dir under/mnt, which you can take, of course.

And then:

sudo gedit/etc/fstab
This command to open the Fstab file, add a line inside it as follows:

/dev/sda7/mnt/dir  ext3  relatime    0  2

sudo mount-a
This command enables the mount to take effect.

Then execute the command to open the file permissions:

sudo chmod 777-r/mnt/dir

Ln-s/mnt/dir ~/dir
This is the/mnt/dir to build a soft link to the Dir directory in the home directory
after you just open dir in the main directory is directly accessible to the/mnt/dir.

OK, now go to dir under your home.

Related Article

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.