[Switch] automatically mount Hard Disk Partitions In ubuntu

Source: Internet
Author: User


1. First, find out the usage of hard disk partitions in our system.
Sudo fdisk-l
Disk/dev/SDA: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = sectors of 1*512 = 512 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00097397

Device boot start end blocks ID system
/Dev/sda1*2048 233476095 116737024 83 Linux
/Dev/sda2 233478142 250068991 8295425 5 extended
/Dev/sda5 233478144 250068991 8295424 82 Linux swap/Solaris

Disk/dev/SDB: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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 identifier: 0x621867fe

Device boot start end blocks ID system
/Dev/sdb1*63 92164904 46082421 7 HPFs/NTFS/exfat
Partition 1 does not start on physical sector boundary.
/Dev/sdb2 92166144 840998911 374416384 83 Linux
/Dev/sdb3 841003008 976773167 67885080 7 HPFs/NTFS/exfat

Sudo blkid
/Dev/sda1: UUID = "d89cb536-6aee-4f32-90de-7f1d50c56028" type = "ext4"
/Dev/sda5: UUID = "23776989-f354-4ffc-9d3b-c299afe9c6dd" type = "Swap"
/Dev/sdb1: UUID = "d6b6542eb65410fb" type = "NTFS"
/Dev/sdb2: Label = "woks" UUID = "6e29fd49-6443-4048-bc4d-d9a391bf2ce9" type = "ext4"
/Dev/sdb3: Label = "winapp" UUID = "1ade5534de550981" type = "NTFS"

What I need to mount is the sdb2 and sdb3 partitions.

2. Modify the partition hanging in the configuration table
Open/etc/fstab

The configuration file contains the following items:

<File system> <mount point> <type> <Options> <dump> <pass>

<File system>: Specifies the partition location. You can specify the disk number, UUID, or label, for example,/dev/sda2, UUID = 6e9adac29ada85cd, or label = software.

<Mount point>: the location of a specific mount point, for example,/Media/C.

<Type>: disk type. Linux partitions are generally ext4 and Windows partitions are generally NTFS.

<Options>: Mount parameter, which is generally ults.

<Dump>: disk backup. The default value is 0. No backup is performed.

<Pass>: disk check. The default value is 0. No check is performed.

Make the following changes as needed:
#/Etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for
# Device; this may be used with UUID = as a more robust way to name Devices
# That works even if disks are added and removed. See fstab (5 ).
#
# <File system> <mount point> <type> <Options> <dump> <pass>
#/Was on/dev/sda1 during installation
UUID = d89cb536-6aee-4f32-90de-7f1d50c56028/ext4 errors = remount-ro 0 1
# Swap was on/dev/sda5 during installation
UUID = 23776989-f354-4ffc-9d3b-c299afe9c6dd none swap SW 0 0

# Work was on/dev/sdb2
UUID = 6e29fd49-6443-4048-bc4d-d9a391bf2ce9/Media/zangcf/Works ext4 errors = remount-ro 0 0
# Winapp was on/dev/sdb3
UUID = 1ade5534de550981/Media/zangcf/winapp NTFS errors = remount-ro 0 0

3. Check and Mount new items
Manually detach the attached hard disk, and then
CD/Media/zangcf
Sudo mkdir winapp
Sudo mkdir works
Sudo Mount-
Mount-A mounts all the items in/etc/fstab. If there is an error, an error is prompted, and you can find out the cause of the error and modify it.

[Switch] automatically mount Hard Disk Partitions In ubuntu

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.