[Switch] Ubuntu automatic hard disk mounting method

Source: Internet
Author: User


First, create a mount directory.
For example:
Sudo mkdir/movie # create a movie folder under the root directory
Sudo mkdir/work # create a work folder under the root directory

View the hard disk information.
Sudo fdisk-l

Disk/dev/SDA: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0x6fd074d4

Device boot start end blocks ID system
/Dev/sda1*1 3251 26113626 7 HPFs/NTFS
/Dev/sda2 3252 48177 360868095 F w95 ext 'd (LBA)
/Dev/sda3 48178 60801 101402280 83 Linux
/Dev/sda5 3252 8414 41471766 7 HPFs/NTFS
/Dev/sda6 8415 21800 107523013 + 7 HPFs/NTFS
/Dev/sda7 21801 47934 209921323 + 7 HPFs/NTFS
/Dev/sda8 47935 48177 1951866 82 Linux swap/Solaris

Disk/dev/SDB: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0x4fd0000d4

Device boot start end blocks ID system
/Dev/sdb1 1 12876 103425446 7 HPFs/NTFS
/Dev/sdb2 12876 38914 209151681 7 HPFs/NTFS

Here we need to automatically mount sda7 sdb2 under work and movie.

Modify the fstab file
Sudo Vim/etc/fstab

SW 0 0
/Dev/cd0/Media/cdrom0 UDF, iso9660 user, noauto, exec, utf8 0 0
/Dev/fd0/Media/floppy0 auto RW, user, noauto, exec, utf8 0 0
/Dev/sda6/DOC auto 0 0
/Dev/sdb1/XP Auto 0 0
/Dev/sda7/work auto 0 0
/Dev/sdb2/movie auto 0 0

Add the blacklist manually
Save, exit, and restart.

[Switch] Ubuntu automatic hard disk mounting method

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.