Ubuntu mounts the new disk to the home

Source: Internet
Author: User


The home disk space is insufficient. Other idle hard disks are from windows and cannot be used directly (Disk format and permissions), such as compiling Android source code. In this way, you need to format the new disk into fat32 and mount it to a directory in/home for convenient use. The procedure is as follows: 1. format the disk: www.2cto.com. run the following command: sudo mkfs-t ext3/dev/sdb1. If the progress starts to show after execution, the task is being executed. It takes time to wait. The following figure shows the Java code 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 www.2cto.com 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768,983 04, 163840,229 376, 294912,819 200, 884736,160 5632, 2654208,409 6000, 7962624,112 39424, 20480000,238 87872 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. B. sdb1 is displayed by running the df command, listing the mounted devices. If the following prompt appears when executing a: Java code mke2fs 1.41.14 (22-Dec-2010)/dev/sdb1 is mounted; will not make a filesystem here! This disk has been mounted and needs to be unmounted: www.2cto.com execute the command: sudo umount/dev/sdb1 Note: It is umount, not unmount! Execute this command and then execute. C. the disk cannot be directly mounted to the home, but can only be mounted to mnt: run the command to mount to/mnt: the sudo mkdir-p/mnt/dir command creates a directory named dir under/mnt. Of course, you can take the directory name as needed. Then run the sudo gedit/etc/fstab command to open the fstab file and add a line as follows: /dev/sdax/mnt/dir ext3 relatime 0 2 www.2cto.com sudo mount-a command to make the mount take effect. Run the following command to open the file: Java code sudo chmod 777-R/mnt/dir ln-s/mnt/dir ~ /Dir: Create a soft link to/mnt/dir to the dir directory in the main directory. After you open dir in the main directory, you can directly access/mnt/dir. OK. Now, go to the dir directory in your home and do whatever you want. Haha. Prepared by dingran

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.