Automatic mounting of linux mint disks. Mounting disks and partitions in Linux

For an IDE, this would be:

/dev/hda, /dev/hdb, /dev/hdc ...

For SCSI, SATA, USB stick - this will be:

/dev/sda, /dev/sdb, /dev/sdc ...

If your disk is partitioned, then the number at the end indicates the partition number:

/dev/sda1, /dev/sda2 ... /dev/sda(n)

Mounting- there is nothing more than an explanation of your OS: about how it can get to your specific data partition, and subsequently make it available to the end user.

What needs to be explained specifically?

What file system do you have on the partition
- what file-device is needed
where do you need to mount it
- mount point

And so, let's proceed to the mounting procedure:

1. How to know what to mount?

To begin with, these actions described below are done from the user root- let's not forget it!

(mydoc is the title mount points in linux, can be anything, in terms of words)

Granting rights to the user)

4. Decide on the type of mount: Single mount or Permanent, in the case of a permanent mount, you need to make changes to the file:

/etc/fstab, after each input, put TAB

5.1. NTFS - mount (hard disk partition, flash drives):

One time:

# mount -t ntfs-3g /dev/sda2 /mnt/mydoc -o umask=0,nls=utf8

Permanent:

/dev/sda2 /mnt/mydoc ntfs-3g umask=0,nls=utf8,user,auto,rw 0 0

Permanent mount in /etc/fstab
* We mount /dev/sda2 with type ntfs-3g exactly /mnt/mydoc

5.2. FAT mount:

One time:

7. Mount CD and DVD disc:

One time:

#mount -t iso9660 /dev/cdrom /mnt/dvd

Permanent:

/dev/cdrom /mnt/cdrom iso9660 user,ro 0 0

8. Mount - EXT2/EXT3/ReiserFS/XFS/JFS:

One time:

Most likely there are shortcomings in the article, I will be glad to hear comments and advice on improving the article, all practical corrections given in the comments will be included in the article with a link to the author) I am waiting for comments!

Original: "How to Easily Automount Windows NTFS partition in Ubuntu"
Author: Abhishek Prakash
Publication date: April 6th, 2012
Translation: N.Romodanov
Date of transfer: June 2012

There is a large number of Linux users who are using a Windows system on their computer by dual booting. And in such a situation, separately for Windows and Linux, you need to create different partitions. Windows typically (but not always) uses the NTFS file system, while Linux typically (again, not always) installs Ext3 and Ext4. When using a Linux system, you have to manually mount the disks. Mounting takes a little time, but in some situations you may want to automatically mount disks every time you start the system, for example, if your music files are on an NTFS partition and you want to use the same directory in Linux, then this disk should be mounted automatically. In this guide, I will talk about the easy way mounting Windows NTFS partitions at system startup.

One way to automatically mount NTFS drives is to edit the fstab table, but for beginner Linux users this can be tricky. Alternative way consists in using a graphical tool called ntfs-config.

To install this tool, open a terminal (press Ctrl + Alt + T) and run the following command:

sudo apt-get install ntfs-config

Or you can install it from the center software Ubuntu Software Center.

Before you can use this tool, you need to set it up a bit, because there is one bug that prevents it from working properly. It looks for a directory to be created. Use the following command to create the specified directory in a terminal window:

sudo mkdir -p /etc/hal/fdi/policy

Now we are ready to use tool ntfs-config. Run the ntfs-config application. Be aware that the ntfs-config application requires administrator rights to run. When you run the application, it will list all the partitions that are on your computer. The interface looks like this:

As shown in the picture above, there are three NTFS partitions on my computer. Check the box next to the partition that you want to automount. In field (<Укажите точку монтирования>) you can specify the name you want to use for this partition, for example windows1.

If you want all your NTFS partitions to be mounted automatically, just click on "Auto Configure" and the program will take care of the rest.

By the way, in case you don’t know how your partitions are named (for example, /dev/sdaX designation doesn’t look like how disks are named in Windows system), you can use the following command in the terminal to find out: :

Sudo fdisk -l

the output of this command (for my computer) will be the following:

Device Boot Start End Blocks Id System /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT /dev/sda2 206848 215541759 107667456 7 HPFS/NTFS/exFAT /dev/sda3 215544166 6251941759 2047 WL5 /devBA sda5 215544168 420340724 102398278+ 7 HPFS/NTFS/exFAT /dev/sda6 420340788 504296414 41977813+ 7 HPFS/NTFS/exFAT /dev/sda7 535547904 545062911 4757504 82 Linux swap / Solaris /dev/sda8 545064960 625141759 40038400 83 Linux /dev/sda9 504297472 529539071 12620800 83 Linux /dev/sda10 529541120 535543807 3001344 82 Linux swap / Solaris

Notice the Blocks column in the output. It specifies the size of the partition in bytes. The example above specifies 102398278 bytes, which is roughly 102 GB.

When you select a mount point, you will have the option to enable disk write support. Turn it on if you need this feature.



Save your settings and close the program, then reboot. After booting the system, you will find that the partitions you need will be mounted.

Here is what I got on my server (I connect to it via )

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 [email protected]:~$ sudo fdisk -l password for sk8er: Disk /dev/sda: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00082da1 Device Boot Start End Blocks Id System /dev/sda1 * 1 1216 9764864 83 Linux /dev/sda2 1216 182122 1453124608 83 Linux /dev/sda3 182122 182402 2247680 82 Linux swap / Solaris Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical) : 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000e67f3 Device Boot Start End Blocks Id System /dev/sdb1 1 243 1951866 82 Linux swap / Solaris /dev/sdb2 * 244 2067 14651280 83 Linux /dev/sdb3 2068 121601 960156855 83 Linux

[email protected]:~$ sudo fdisk -l password for sk8er: Disk /dev/sda: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00082da1 Device Boot Start End Blocks Id System /dev/sda1 * 1 1216 9764864 83 Linux /dev/sda2 1216 182122 1453124608 83 Linux /dev/sda3 182122 182402 2247680 82 Linux swap / Solaris Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical) : 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000e67f3 Device Boot Start End Blocks Id System /dev/sdb1 1 243 1951866 82 Linux swap / Solaris /dev/sdb2 * 244 2067 14651280 83 Linux /dev/sdb3 2068 121601 960156855 83 Linux

As we see connected 2 hard drives. In this case, I was guided by the size of which of them is internal (the first in the result), and which is external (second). External drive divided into 3 parts, I need a third, because it is on it that the necessary files are located. We see that the third section is called /dev/sdb3, that's exactly what we need. Now enter the mount command:

/dev/sdc1 /mnt/win ntfs defaults 0 1

  • /dev/sdc1- mounted device
  • /mnt/win- mount point
  • ntfs- specify the file system of the partition
  • defaults- default mount options
  • 0 - backup flag (details below)
  • 1 - check flag (details below)

So, at the beginning, a small table with mount options

  • exec- Permission to run executable files. The option is enabled by default.
  • noexec- Prohibition to run executable files.
  • auto- The partition will be automatically mounted when the system boots. Default.
  • auto- The partition will not automatically mount when the system boots.
  • ro- Read-only mount.
  • rw- Mount for reading and writing. Default.
  • user- Allowing ordinary users to mount/unmount this partition.
  • nouser- Prevents ordinary users from mounting/unmounting this partition. Default.
  • defaults- Use of all parameters by default.

Backup Flag:

  • If 1, dump will include this partition when backing up.
  • If 0 - then this section will not be included during backup.

Check flag. Sets the order in which the partition is checked for errors during mounting. If you set the same order for two sections, they will be checked at the same time. If 0 - the section is not checked.

There is also a common error like this one: mount: mount point /mnt/hard does not exist. Here you simply forgot to create a folder that is the mount point. We create and everything works.

If you have two operating systems installed on your computer: Linux and Windows 8, 8.1 or 10 and you want to mount the system partition in order to copy files from there or write files there, you will most likely encounter an error. The file manager and the mount utility will give the following message: "error mounting: windows is hibernated refused to mount". This is due to the newer versions of Windows using a hybrid boot algorithm using hibernation, which prevents you from accessing your files.


This message may confuse you. As a rule, we turn off Winodws in the usual way, but Linux claims the system to be in hibernation mode. But we didn't use hibernation. The point is that modern Windows versions use hibernation by default to speed up loading.

Why is this happening

When you turn off modern operating system Windows, it does not turn off completely, but goes into hibernation. Then at boot time, the initial state is simply restored. This speeds up the boot process, but also has a disadvantage when using Linux.

To fix the “windows is hibernated refused to mount” problem, just boot Windows and disable hybrid boot. The only downside to this method would be slowing down the system boot. It will boot at about the same speed as Windows 7. But you can still mount a Windows partition on Linux.

You do not need to install additional software on your Linux distribution. Most distributions, such as Ubuntu, already include the ntfs-3g package and work fine with the Windows file system.

Complete shutdown of Windows

Windows does not use hybrid boot during reboot. If you select the restart item, the saved initial state will be deleted and a new one will be created.

So if next time you want to go to Linux system from Windows - select the restart item. So the system will not go into hibernation and you will not have errors while mounting the Windows partition in Linux.

If you just need to turn off the computer, there is another way. Hold down the Shift key when you select the menu item Turn off. Then the system will also not use hibernation and turn off completely.


Whichever option you choose, when booting back into Linux, the Windows system partition will be mounted successfully and you will be able to access your files.


Completely disable hybrid boot

If you don't want to think about which button to press and what to do every time you restart Windows, you can completely disable hybrid boot. But then Windows will boot more slowly. This may also be necessary if Hardware computer does not support hybrid boot. After disabling it, you can easily mount Windows partitions on Linux without any errors.

To do this, boot into Windows, open the control panel, click the "Hardware and Sound" button. Under Power Options, select Change what the power buttons do



Deleting the Hiberfile.sys file

Instead of reconfiguring Windows, you can automatically remove the hibernation file every time you need to mount Windows partitions on Linux. Of course, after such a procedure, the system will boot more slowly, but then it will again create hybrid boot files and continue to use quick launch. This is ideal if you rarely use the windows system partition and do not want to lose download speed.

But keep in mind that if you do indeed hibernate the computer leaving open programs and unsaved data, then Linux will still delete the real hibernation file along with all your data. The difference between the types of hibernation cannot be determined.

To remove the hiberfile.sys file, just add the mount option file system ntfs "remove_hiberfile". You can see the same advice when trying to mount the system partition with ntfs3g.

On Ubuntu and other distributions with the Gnome shell, this can be done using the Dsiks utility:


On the right side of the program window, select HDD with Windows, then select the Windows system partition. Click on the gear button and select Edit Mount Options:


Toggle the Automatic Mount Options switch to Off, then paste the following line at the end of the mount options at the bottom of the window:

Remove_hiberfile

Click "Ok" and enter your password. Now you can try to mount the Windows system partition in file manager Nautilus. As you can see, the mount is successful without any errors. If the hibernation file was included, the system will simply delete it.


If your distribution does not have the disks utility or you just need to mount a windows partition in Linux once, despite the error mounting windows is hibernated and without setting any automatic options, use the mount utility. The command needs to pass the name of the Windows system partition to enable the same option, for example:

mount -o defaults,rw,remove_hiberfile -t ntfs /dev/sda1 /mnt/ntfs

Here /dev/sda1 is the Windows disk partition and /mnt/ntfs is the mount point.

These steps are necessary only if you need access to write files to the windows system partition. If you just need to view or copy a particular file, you can mount windows partitions in Linux in read-only mode. For example:

mount -o defaults,ro -t ntfs /dev/sda1 /mnt/ntfs

On Linux, you can mount system partitions in mode only reading, even when Windows system in hibernation.

findings

The use of several systems on one computer is very often practiced by beginners. Sharing files between two systems is a normal occurrence, and therefore you will encounter this error very often. But this article will help you solve it once and for all. If you have any questions, write in the comments!