• Mounting a disk in Ubuntu. Mounting hard drives and partitions in Linux

    Sooner or later, Debian users are faced with the concept of mounting partitions and disks. Many, especially former Windows users, have difficulty mounting partitions, although if you think about it, everything is very simple and logical. Below is a description of the mounting process in UNIX systems and analysis of the most typical cases. And even if you're surrounded by a GUI, knowing console commands can come in very handy. In addition, having learned a couple of useful UNIX commands, you will become familiar with this black magic and maybe start using it.

    Mounting partitions in Linux - general words

    If the Linux kernel has recognized your storage device, it should provide some kind of front end user to operate the device. This interface is to create device files in the directory /dev

    Devices connected to IDE, device files will correspond /dev/hda, /dev/hdb and so on.

    Device type SCSI, as well as those close to them in spirit SATA-devices and USB-flash drives will have file-devices /dev/sda, /dev/sdb and the like.

    If the disk has partitions, then the number in the file-device name will correspond to the partition number.

    If there are two partitions on a USB flash drive, then the first one will be called /dev/sda1, and the second /dev/sda2

    Mounting partitions- This is an explanation to the system of how to get to your data and make it available for use. The system needs to explain three simple things:

    1. what file system is on the partition;
    2. what file device do you need;
    3. where to connect it for viewing = mount point;

    The directory where you will view the contents of your partitions is called the mount point. Therefore, you need to explain to the system - by command or through GUI- what you want to mount, where and what kind of file system is on this partition.

    Translated into UNIX language, it sounds like this:

    mount -t vfat /dev/hda3 /mnt/harddisk

    If you need to mount the same partitions frequently, add them to /etc/fstab- this is a system config that specifies all the necessary partitions for mounting. This file can be edited by no one, but only root. So just get root permissions and edit /etc/fstab

    File /etc/fstab consists of columns separated by tab characters (TAB key). Here is an example of the file contents /etc/fstab:

    # /etc/fstab: static file system information.
    #
    #
    /dev/hda2/reiserfs notail,noatime 0 1
    /dev/hdb /mnt/cdrom iso9660 ro,user,noauto 0 0
    /dev/sda1 /mnt/flash vfat iocharset=koi8-r,codepage=866,rw,user,auto 0 0

    The column format is as follows:

    • Mountable device(file-device, also known as the partition you want to mount)
    • Mount point(in which directory in the file system to mount)
    • Mounted file system type
    • Mount Options(language encoding, need to mount at startup)
    • Dump(usually 0)
    • Pass(usually 0)

    It is important that you insert a Tab after each column when editing /etc/fstab(After each text color change in this example)

    Below are examples of mounts for each file system.

    One-time FAT mount

    Temporary, one-time mounting, for example, of a flash drive, looks like this on the command line (let me remind you once again that all operations are carried out as root):

    mount -t vfat /dev/sda1 /mnt/usb

    Permanent FAT mount

    /etc/fstab adding the line:

    /dev/sda1 /mnt/usb vfat iocharset=utf8,codepage=866,user,rw 0 0

    One-time NTFS mount

    Temporary, one-time mounting, for example, of a partition with Windows data, looks like this (let me remind you once again that all operations are carried out as root):

    mount -t ntfs-3g /dev/sda1 /mnt/win

    Permanent NTFS mount

    If you need to constantly refer to these sections, edit /etc/fstab adding the line:

    /dev/sda1 /mnt/win ntfs-3g umask=0,nls=utf8,exec,user,auto,rw 0 0

    Mounting a CD/DVD drive in Debian

    Most likely, this is already done in your distribution. However, I present it here as an example.

    One-time CD/DVD mounting

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

    Permanent CD/DVD mounting

    If you need to constantly refer to these sections, edit /etc/fstab adding the line (let me remind you once again that all operations are carried out as root):

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

    Mounting an ISO File in Debian

    You downloaded an ISO file from somewhere and want to view its contents. Windows has a lot of software for this. In Linux and UNIX in general, such software is not required, since mounting an ISO image for the system is no different from mounting a CD/DVD disk. You only need to pass one parameter -o loop to tell the system that we are going to mount on a loopback device ( loopback). If you need to do this a lot and often, you can use the GmountISO program

    mount -t iso9660 file.iso /mnt/dvd -o loop

    That is, we mount the file.iso file of type iso9660 to the mount point /mnt/dvd on the loop device loop

    Unmount on command.

    Hello, dear readers of the site "". Today we will continue to introduce you to the wonderful inner world of Linux systems and introduce you (as you probably already understood from the title of the article) with mounting in operating systems “running” Linux.

    And, of course, we will try to present the information in a simplified version, i.e. We will mention little and pay more attention to working in graphical mode. Well, that’s how it goes. Well, no need to delay, let's go.
    Let's imagine this situation for a second. You have decided to install Linux second operating system along with Windows. We installed it, launched it, and then wanted to look at the partitions Windows through the eyes of Linux users :). And, - Oops! - a slight disappointment may await you here, because you do not see this (section) (we are considering a simple case when you have installed ntfs-config to work with ntfs-partitions, and the system sees your partitions, but did not mount them for some reason).

    Next, to start using it, we will need to connect or, in other words, mount this invisible device. To begin with, let's remember one of the previous articles - ", where we said in a slightly veiled way that the file system (FS) Linux is very closely related to mounting, and more specifically, it was mentioned that the file system is one large tree with a root directory / (slash). And mounting the root file system is part of the kernel initialization process. During the loading process of the operating system, a sequential (and not just any) connection of all visible (and invisible too :)) devices by the system occurs.

    In modern distributions you will not see the process of loading the kernel itself, because all this happens behind beautiful background. But sometimes this information is very useful, because in addition to data about mounted devices, various useful kernel messages are displayed - about the available equipment; about and technologies that are supported; and most importantly and valuable - about errors, if any. To see all messages from the booting system, type the command:

    Loading the kernel is a separate conversation, we won’t dwell on it now, just enter the above command and carefully study everything that is displayed on the monitor screen. I assure you, you will find a lot of “delicious” things there.

    Let's understand further. Here's the core Linux has identified all your devices that contain data. And then what? And then it is simply obliged to provide you and me with some kind of external link For further work with these devices. And, paradoxically, the role of such links will be device-files, which are created in the / directory dev. This is the only way you and I can gain access to the files and directories that are located on our, hidden from view, disk or disks, depending on who you are. Many may have a reasonable question - why bother doing it with your hands if modern systems Linux do they deal with it automatically? Believe me, sometimes this is necessary; there are isolated cases when the system Linux cannot automatically connect the disk due to some reasons related to disk failure, viruses that are infected NTFS/FAT-sections or because of something else unnatural. And then real (or very smart users ;)) do it manually using the command:

    Which gives roughly the following result:

    Let's clarify a little what we see in the figure. We observe a real mounting process at the initial stage of system boot. The pseudo-file system was the first to join (remember that it is used to provide information about processes), then the virtual file system / sysfs, which exports kernel information to user space Linux about devices and drivers present in the system. Next to the directory / dev mounted tmpfs. This is a temporary file storage intended for mounting FS, with the only difference being that it is located in RAM instead of a physical disk, i.e., in another way, it is . Here files are created for those devices that are present in the system and that could be created “on the fly” - these include connections via USB(or when a dynamic module with a device driver is loaded).

    And so on, and so on, that is, everything is connected sequentially, in order. In order not to scare you with abstruse terminology, let's come down to earth and continue our conversation about editing. The last closing link is: disk ( /dev/sda) and replaceable USB-device ( /dev/sdb). I think there is no need to tell you that if a disk (or any other removable device) has not one partition, but several, then all the existing partitions will be attached and the only difference will be in the name file-devices. For example, if on disk 5 partitions, then the device files will be called /dev/sda1, /dev/sda2, /dev/sda3, /dev/sda4, /dev/sda5.

    Conclusion:
    How many sections are there on removable disk, so many file-devices will be connected.

    The same command output can be obtained if we open the contents of the file /etc/mtab(on some systems Linux the file is called / etc/mnt/tab)

    # cat /etc/mtab

    Let's get to practice. See which devices are connected to at the moment to the computer using the command:

    # sudo fdisk -l

    Your output may be completely different from the figure below:

    Please remember that the mount/unmount process is performed with privileges root, what does the icon mean? # And sudo

    Next. From the picture you can see that there is only one available, where there are three mount points- this is the swap file, directories and home(When installing the system, it was more convenient for me to partition the disk this way).

    Do you want to know and be able to do more yourself?

    We offer you training in the following areas: computers, programs, administration, servers, networks, website building, SEO and more. Find out the details now!

    With a probability of 90 I'm sure that there is not only one disk on your computer, but there may be several of them and they can be divided into partitions. To access these partitions, we need to mount them to the root file system and only then can we access the contents of these partitions through the mount point.

    Now let's move on to training. Let's assume that we only have at hand CD/DVD-ROM. Let's try it on it.

    1. Insert the disc into the drive.
    2. It will be automatically determined by the system for you, i.e. mounted (see picture below):


    3.
    Unmount it with the command:

    sudo umount /dev/cdrom

    Take a look at the picture - CD/DVD-ROM unmounted (as evidenced by the absence of a triangle next to it), but..

    It is visible in the system (that is, defined by the system, but not mounted), and therefore, in order to verify the authenticity of this, type the command:

    mount | column -t

    As you can see, the team showed that CD/DVD-ROM absent.

    And now the most interesting thing, namely, we begin to shamanize with the addition of our, so to speak, CD back. To do this you will need a shamanic tambourine and straight arms :)

    1. In order not to suffer too much with superuser rights, we will mount it back to the same directory from where we extracted it, namely in /run/media/username. Why here? It's simple. Catalog /run was intended as temporary storage for "security" purposes, and this folder ( /run/media/username) deliberately remains empty after the system boots, so you won’t find anything other than mounted disks (or other removable devices) there (provided, of course, that you don’t do something wrong yourself). But in general, before we attach it there, we must

    2 . Create directory - /CDROM

    sudo mkdir /run/media/username/CDROM

    3. Mount with command

    sudo mount -t iso9660 /dev/sr0 /run/media/username/CDROM

    -t iso9660- a mount parameter that is usually determined automatically, but in some special cases this parameter must be specified so that the system does not say: “Oh.. It’s such a shame that you did not define the file system type.” In our case, the file system type is iso9660- this type defines all CD-, DVD- disks;

    /dev/sr0- this is our CD, where this name came from is easy to determine from the command, and at least mount | column -t (or use disk utilities, which are in any linux-system);

    /run/media/username/CDROM– a required parameter, otherwise the system will not understand where you want to attach all this.

    On the command line everything was done in three lines :)

    Let's mount the flash drive in the same way:

    1. Insert the flash drive into USB

    Our flash drive is identified as a file device /dev/sdb1 with name 3C9B-F329 and with the file system FAT32.

    sudo umount /dev/sdb1

    And we see something like this:

    3. Now let's create a folder in the directory /run/media/username/

    sudo mkdir /run/media/username/3C9B-F329

    4. We mount

    sudo mount /dev/sdb1 /run/media/username/3C9B-F329

    The output we get is something like this:

    So here it is. Throughout the entire article, you have been led to the most important conclusion: by mounting partitions, we “gently” explain to the system how to get to the data and make it available for use for our purposes. The main thing here is that the directory or subdirectory exists, otherwise, if it does not exist, then our entire process will end with a mounting error.

    Please note:
    During the mounting process it is actually mounted FS any device (or other resource). It is common to talk about “mounting a device”, although in fact it is meant that we are talking about “mounting the file system of a device”.

    However, enough of the terminal, let's move on to more simple ways using graphical tools.

    There are many utilities and programs for working with disks and partitions (the simplest utility is automatic mounting, which is performed by the system itself), but there is one “but”... In each Linux-the system has its own utilities. Therefore, we simply cannot physically reach all of them. For example, in Ubuntu there is a built-in utility for working with disks" NTFS Write Configuration Tool", and you can also install the utility " Mount Manager". IN " Fedora" same - " palimpsest"what is included" gnome-disk-utility".

    On top of everything else.. Yes general program for working with partitions and disks in any Linux-system - this. This program is completely free and can not only mount, but also very, very many things, but we will not consider everything that it is capable of, but will analyze only two operations. Let's just briefly, in the form of instructive instructions:

    How to unmount a partition using Gparted:

    1. Run the program itself (with rights root)
    2. Select the mounted partition (there is a selection of partitions at the top right - highlighted with a red rectangle).
    3. Next, select from the menu " Chapter - Unmount". Well, or use the right mouse button on the selected section and select " Unmount". After this, the program will detach the partition (in in this case flash drive)

    If the detach operation fails, then most likely the partition is currently in use by other processes and therefore cannot be unmounted. In this case, you need to use Live CD Gparted:

    Now to the second operation.

    How to mount a partition in GParted:

    1. Run the program (from root rights)
    2. Select a partition that has not yet been mounted (the main thing is that it is defined by the system).
    3. Next go to " Chapter - Mount" and select a mount point from the list. Or right-click on the highlighted section - " Mount", after which it will mount the partition to the specified mount point.

    If the menu item " Chapter - Mount" is not visible (i.e. not active), which means it does not know at which point to mount the partition. In this case, you need to use Live CD Gparted.

    But most of all, in general, I like the utility in openSUSE(German distribution) and/or its wonderful " Control Center" ("System parameters") YaST, with which you can without special problems mount/unmount whatever you want.

    The process is:

    1. Run YaST(you can use command line with rights root - /usr/bin/xdg-su -c /sbin/yast2 or via the graphical interface - " System parameters- YaST").
    2. Go to " System - Sections"

    Most likely, you will be warned that this operation is not so harmless, and you understand the degree of harm that can be caused to the system if you do something not entirely correctly. But you still agree and press " Yes " .

    Now the disk partition editor window will open, where select the partition (on the left) – "Hard drives", and on the right will be a list of all drives that are currently connected to your computer. Look for the one you want to attach (in our case, we will select the very last line - this is a flash drive).

    Reminder - don't forget to disconnect the drive you'll be experimenting with.

    Do it regular means, namely just click on the triangle icon in Explorer:

    Please note that one disc occupies at least two lines. The first is its physical name and marking, and the second is the logical disk (partitions) with a file system.
    Look at the highlighted line - the file system type is indicated there. We have it FAT32.
    Select your drive and click on the button "Edit", which is located at the bottom of the window.
    The settings window will open. Make sure there is a checkmark next to the item "Do not format".

    Usually all disks in Linux mounted to a folder /run/media/username, which we mentioned above.

    Therefore in the line " Mount point" Enter the following path to mount your disk: /run/media/username/your drive name(in our case it will look like this: /run/media/username/3C9B-F329).

    As soon as you enter this line, the button will immediately become available " . Click on it, and in the window that opens, mark the item with a dot " Device ID" and check the box " User-mountable. This is necessary so that you can use the disk in regular user, and not just the administrator.

    Now look at the point " Values ​​of arbitrary options". Find the text there umask=0002, and replace 0002 on 0000 (these are the access rights to the section) and agree to all changes by double-clicking OK and you will be returned back to the list of disks. And, lastly, actually - in this window, click OK. The program will again warn you that all changes will now be written to the file. If you are sure of what you are doing, confirm the changes by clicking the button " Apply".

    As a result, if everything was done correctly, then by going to the folder /run/media/username(by the way, you can also look through file manager, namely, you can enter the terminal and type the command ) You will see:

    Hurray, here is our mounted flash drive. You can rejoice. Poor flash drive... What has it not survived at the time of writing this article?

    Afterword.

    OK. This concludes our story. Stay with the project, you are welcome here.

    Traditionally, I say that you can leave all questions, as well as additions, opinions, reviews, criticism, gratitude, etc., in the comments to this very article.

    P.S. Thanks to a member of the Pantera team for the existence of this article.

    Welcome back my hackers!
    One "misunderstanding" Linux that users constantly encounter Windows, is the concept of "mounting" devices and disks. in the world Windows drives and devices are automatically "mounted" without any effort on the part of the user and without even realizing that this is happening. Well, maybe suspicions about this are creeping in. Most users Windows know how to disconnect a flash drive before removing it from a computer, but usually think of this process as “ejecting.”
    Team mount traces its history back to the prehistoric era computer technology(since the 1970s), when computer operators physically mounted tape drives onto behemoth-like gym-sized computers. Data was stored on these drives (since hard drives had not yet been invented), and the operator had to tell the machine that he was editing the tape before it could be read.

    Windows usually automatically mounts Plug-enabled drives and devices and Play, so users don't have to worry about mounting them. The system assigns each disk or device a letter designation of its mount point, for example, C:, D:, E:, etc.
    In later distributions Linux Automatic mounting is often supported, but a true administrator needs to understand the process and know the command mount, since they will someday need to mount a device or drive that is not automatically mounted. This situation occurs every day in the work of any ordinary person. system administrator Linux and especially in the work of cybercrime investigators or hackers.

    Step 1. File structure

    Remember that you Linux a single tree structure for the entire file system (as opposed to Windows) with a root for each drive and device. This means that all drives and devices are part of a single file system tree with a "/" at the very top. Any other drives must be mounted to this tree. We can do this with the command mount.


    When we mount a device, we place it in some directory and it becomes part of the tree. We can mount any device to ANY directory, but when we do this, the directory in which the device is mounted will become “closed” and inaccessible to us. This means that we will not be able to access any of the files in this directory. Of course, this is not very good. That's why we have special empty directories for mounting devices. Their names differ from one distribution Linux to another, but usually it's either /mnt or /media.

    Step 2. Mount Command

    Let's take a look at the team mount. Enter in the console:

    Mount -h

    This will display command help as shown below:


    The screenshot highlights the most important part of the command syntax. Basically these are:
    mount -t<тип файловой системы> <расположение>
    Team mount in this form it will “mount” a file system of a certain type (-t) in the specified location. So, for example, we could mount a cdrom in the /media directory by typing:

    Mount -t /dev/cdrom /media

    This command will mount the cdrom to the /media directory in the file system tree.
    We also have a variety of options that can be used when mounting devices, including:

    rw- mount read/write

    ro- mount read-only

    user- allow any user to mount devices/disks

    auto/noauto– whether the file system will automatically mount the device/disk

    exec/noexec- allow or deny execution of binary (executable) files on the mounted device

    You can look at the built-in manual (man) for the command mount to find out all its options:

    Man mount

    Step 3: Setting up automounting using Fstab

    Fstab- This " F ile s system tab le" (file system table). In the system Linux it's simple configuration file. Team mount reads fstab to determine which options to use when mounting a file system. Thus, it automatically detects the connection parameters when we mount the device. She just reads the entry in the table fstab For of this device and applies the mount parameters that are specified there.


    As you can see in the screenshot above, we simply displayed the contents of the file fstab using the cat command:

    Cat fstab

    Table fstab consists of six (6) columns. Here they are:

    Device(device) - UUID (Universal Unique Identifier)

    Mount point(Mount point) - the directory where we want to mount the device

    Type(Type) - file system type, for example: ext2, ext3, swap, ISO9660, etc.

    Options(Parameters) are: rw (read/write), auto, nouser, async, suid, etc.

    Dump(Dump) - specifies how often to back up this drive

    Pass- defines the "pass" option when fsck should check the filesystem.

    Step 4: Unmount

    When we need to unmount (unmount) a disk or device, then the command we should use is umount. Pay attention to its spelling. It's called umount, not unmount.
    To unmount our cdrom device that we mounted above, enter:

    Umount /dev/cdrom

    You will not be able to disconnect a drive or device that is currently in use by the system.
    Come back for more tutorials on hacking and the basics Linux, which you need to know to hack like a real PRO.

    If your computer uses Linux and Windows in parallel, you may need to work with the ntfs partition while in Linux. In order for ubuntu to work with disks in the ntfs file system, you need to install the ntfs-3g driver

    sudo aptitude install ntfs-3g ntfs-config

    (there is a graphical configurator for the driver. Launched with the command sudo ntfs-config I can’t say anything, I haven’t used it.)

    For convenience, you need to configure automatic mounting of the partition (or hard drive) with Windows when loading Ubuntu. To do this, you need to mount the partition by adding the necessary parameters to the /etc/fstab configuration file.

    First, find out the name of your Windows partition. You can see the list of disks using the mount command (more details

    For this example, the partition in ntfs will be designated as /dev/sda1

    Now you need to determine the disk identifier /dev/sda1 (UUID) using the command ls -l /dev/disk/by-uuid/ or sudo blkid

    The UUID is written to /etc/fstab instead of /dev/sda1. For example, take the value UUID=363C991F3C98DAE7

    Now we need to create a directory in which we will mount the ntfs partition. You can mount it in any directory, even on the desktop, but for convenience it is better to select /media/. Let's call the directory in which we will mount the partition with Windows - windows

    Create a directory with sudo mkdir /media/windows/

    Just in case, make a copy of fstab with the command sudo cp /etc/fstab /etc/fstab.backup

    Open /etc/fstab with the command sudo gedit /etc/fstab and add to

    file partition parameters with ntfs

    UUID=363C991F3C98DAE7 /media/windows/ ntfs-3g users,defaults,umask=0 0 0

    These values ​​in /etc/fstab can be changed if necessary. Let's take a closer look at them.

    /dev/sda1 is physical disk or partition with Windows. Each device has its own number. /dev/sda1 is numbered 1.

    If you mount a CD or DVD, it will be designated as /dev/cdrom. Disk drive as /dev/fd

    Hard drives are designated as follows:

    IDE: primary master is designated as /dev/hda

    primary slave is designated as /dev/hdb

    secondary master is designated as /dev/hdc

    secondary slave is designated as /dev/hdd

    SCSI/SATA is designated as /dev/sd

    /media/windows/ is the mount point of the Windows partition. The section will be accessed through it.

    ntfs-3g is a file system in NTFS. For cd/dvd it is written as iso9660, udf. For

    floppy drives, flash drives and fat32 - vfat

    Parameters that determine how this file system will be processed (written separated by commas, without spaces):

    users - allows users to mount and unmount this directory (some write user. I don’t know what the differences are)

    defaults - default parameters (exec, auto, rw, nouser parameters are used)

    Additional options:

    exec - launch executable files allowed (enabled by default)

    noexec - launching executable files is prohibited.

    auto - automatically mounts the partition when the system boots. (enabled by default)

    noauto - the partition will not be automatically mounted when the system boots.

    ro - mount the partition with read-only rights.

    rw - mount a partition with read and write permissions (enabled by default)

    nouser - prohibits ordinary

    users can mount and unmount the partition (enabled by default).

    suid and nosuid - enable and disable suid and sgid bits

    sync and async - determines how writing/reading occurs in the file system. Synchronously and asynchronously.

    locale=ru_RU.UTF-8 - can be added if there are problems with the language.

    Then comes the backup flag. 1 - at backup dump will include this partition. 0 - this partition will not be included during backup.

    And behind it is a check flag which, when mounted, sets the order in which the partition is checked for errors.

    To view mounted partitions, use the mount -l command

    You can view /etc/fstab in the console with the command cat /etc/fstab

    On various computers the options in /etc/fstab are not the same. They may be different for you. The above configuration can work on one

    car and not make money on another. If errors occur, read what is written in the error output. Change parameters, try using values ​​taken from /etc/fstab files of other users.

    If you need to connect/mount hard drive from file NTFS system or ext2, ext3 to a computer based on the Linux operating system, then you are reading the right article.

    Why do it manually if modern Linux desktop systems do it automatically?

    There are some cases when the system Linux cannot automatically mount/connect a disk due to some logical failures of the disk, viruses that infected NTFS/FAT partitions, or due to something else anomalous. To do this, real system administrators do it manually. And they do this with the mount command.

    The mount command in Linux is a very flexible tool in the hands of a system administrator. Using the mount command you can mount network drive, hard drive partition or USB drive.

    This article is not a complete, exhaustive description of the mount command ( full description The mount commands can be found by running the man mount command in the console), but strive for this. The article describing the mount command is constantly being updated and modified. You can leave all your suggestions regarding the article in the comments.

    The devices that are currently connected to the computer can be viewed by typing in the console:

    This command shows all devices that are connected. They may not be mounted, but they are connected. On the screen you will see something like this:

    Disk /dev/sda: 40.0 GB, 40020664320 bytes
    255 heads, 63 sectors/track, 4865 cylinders

    Disk identifier: 0x815aa99a Partition table entries are not in disk order
    Disk /dev/sdb: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x973248ad

    Device Load Start End Blocks Id System
    /dev/sdb1 * 1 9729 78148161 83 Linux

    Disk /dev/sdc: 1027 MB, 1027604480 bytes
    32 heads, 62 sectors/track, 1011 cylinders
    Units = cylinders of 1984 * 512 = 1015808 bytes
    Disk identifier: 0x6f20736b

    From the listing above you can see that the following is connected to the operating system:

    1. two hard drives: /dev/sda - operating system and /dev/sdb - “file dump”
    2. removable USB drive: /dev/sdc
    Viewing mounted devices is carried out with the command:

    After this you can see on the screen:

    /dev/sda1 on / type reiserfs (rw,relatime,notail) tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
    /proc on /proc type proc (rw,noexec,nosuid,nodev)
    sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
    varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
    varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
    udev on /dev type tmpfs (rw,mode=0755)
    tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
    devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
    fusectl on /sys/fs/fuse/connections type fusectl (rw)
    lrm on /lib/modules/2.6.27-14-generic/volatile type tmpfs (rw,mode=755)
    /dev/sda3 on /home type ext3 (rw,relatime)
    securityfs on /sys/kernel/security type securityfs (rw)
    binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
    gvfs-fuse-daemon on /home/user/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=user)
    /dev/sdc on /media/USBFlash type vfat (rw,nosuid,nodev,uhelper=hal, shortname=mixed,uid=1000,utf8, umask=077,flush)

    • the first line states that the root file system is the reiserfs file system with mount parameters: read and write access (rw)
    • /dev/sda3 is the /home disk partition
    • /dev/sdc is a mounted removable USB device
    The same result can be achieved by looking at the contents of the /etc/mtab file (on some systems Linux file called /etc/mnt/tab)
  • Hummingbird
    27 March, 09:27

    after I entered this command: sudo chmod -R 0777 /home/roza/Desktop There were no error messages in Debian, but in Mint, during boot, a message appears with the following content:

    The user file $HOME/.dmrc has incorrect permissions and is ignored. This prevents the default session and language from being saved. The owner of this file must be the user and the file must have permission 0644. The user's home folder ($HOME) must be owned by the user and must not be writable by other users.

    Then everything freezes for a few seconds and the desktop opens. And now I can’t use either sudo or just su - the terminal is not swearing in Russian. Is it possible to restore rights to ($HOME). Maybe this can be done using a Mint live disk?

  • Mut@NT
    29 March, 12:13

    Hummingbird: Then everything freezes for a few seconds and the desktop opens. And now I can’t use either sudo or just su - the terminal is not swearing in Russian. Is it possible to restore rights to ($HOME). Maybe this can be done using a Mint live disk?

    Well, try to return the rights back:
    sudo chmod -R 0644 /home/roza/Desktop

    And the owner:
    sudo chown -R YOUR_LOGIN_IN_MINT /home/roza/Desktop

  • Hummingbird
    2 April, 08:43
  • Mut@NT
    3 April, 13:39

    Hummingbird: Still, nothing worked :(. In general, I reinstalled the partition with mint. The main thing is that I learned how to mount partitions (I understood how it’s done, then it’s easier) And I also learned a lesson for myself - you need to distribute rights very carefully. Thanks anyway!

    P.S. The main thing is that you learned something))

  • Alex Under Construction
    19 May, 08:41

    Thank you.
    A couple of additions.
    1. For example, my hard drive partition did not want to be mounted after connecting to a Windows machine that was infected with viruses. It so happened that the virus threw autorun.exe at the root of my partition and because of this Linux did not want to mount this partition.
    I didn’t want to mount it not because of autorun.exe, but because most likely the Windows were extinguished “incorrectly” and there was a byte on ntfs about checking the integrity of the file system. In this regard, ntfs3g without “force” is afraid to mount such a FS, so as not to damage it.
    2. Since there is a section about “SMB”, it would be worth mentioning CIFS.
    And as an example, give something like:
    mount -t cifs -o username=domain\user //remote-win2k3-server/C$ /mnt/smb/

  • Nefazhno
    20 May, 15:26
  • Tonik
    24 May, 03:04
  • Mut@NT
    26 May, 17:27

    Alex Under Construction: Thank you. A couple of additions. 1. For example, my hard drive partition did not want to be mounted after connecting to a Windows machine that was infected with viruses. It so happened that the virus threw autorun.exe at the root of my partition and because of this Linux did not want to mount this partition. I didn’t want to mount it not because of autorun.exe, but because most likely the Windows were extinguished “incorrectly” and there was a byte on ntfs about checking the integrity of the file system. In this regard, ntfs3g without “force” is afraid to mount such a FS, so as not to damage it. 2. Since there is a section about “SMB”, it would be worth mentioning CIFS. And as an example, give something like: mount -t cifs -o username=domain\user //remote-win2k3-server/C$ /mnt/smb/

    Not important: It would be nice if NFS mounting was also described

    Thanks for your comment. I'll add some additions.

    Tonik: And the article helped me. Elementary! – I forgot how to mount it... I quickly skimmed through the article and remembered. Thanks a lot to the author!

    Come back often :)

  • Denis
    11 June, 11:47

    thanks for the article,
    very good intelligibly

  • Lyudmila
    9 July, 13:05

    # sudo mount -t smbfs -o username=vasja,password=pupkin //pupkin_v/Video /home/user/video
    doesn't work, gives help
    usage: ……
    I work in ubuntu. you need to connect the shared one windows folder
    Maybe the team is wrong?

  • Mut@NT
    9 July, 22:11

    Lyudmila:# sudo mount -t smbfs -o username=vasja,password=pupkin //pupkin_v/Video /home/user/video does not work, gives help usage: ...... I work in ubuntu. you need to connect the shared windows folder. Maybe the command is wrong?

    Line
    username=vasja,password=pupkin
    must be replaced with the required parameters. If you connect on behalf of a guest, then you need to be careful, there are nuances and differences between Russian and English Windows OS

  • Andrey
    31 August, 10:04

    In Ubuntu it should be like this:
    mount -t cifs -o username=tridge,password=foobar //fjall/test /mnt/smb/fjall

  • C.J.
    14 September, 20:28

    cj@Monster:~$ sudo umount /dev/sda1
    umount: /: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))
    cj@Monster:~$ df -h
    File system Size Use Dost Use % mounted on
    /dev/sdb1 26G 9.1G 16G 37% /
    none 1.7G 416K 1.7G 1% /dev
    none 1.7G 0 1.7G 0% /dev/shm
    none 1.7G 200K 1.7G 1% /var/run
    none 1.7G 0 1.7G 0% /var/lock
    none 1.7G 0 1.7G 0% /lib/init/rw
    /dev/sdb6 33G 15G 19G 45% /media/4403D3D754B7C8F5
    /dev/sdb5 30G 22G 8.1G 74% /media/Win7
    /dev/sda5 50G 8.9G 41G 18% /media/Other
    /dev/sdc1 373G 372G 946M 100% /media/STORAGE
    /dev/sdb7 94G 88G 5.5G 95% /media/MUSIC & GAMES
    /dev/sda1 26G 9.1G 16G 37% /

  • Vladimir
    15 September, 09:46
  • Mut@NT
    19 September, 20:14

    CJ: We need to mount the /dev/sda1 disk, but it claims that it is already mounted at point “/”, although it is mounted at this point system partition Ubunts. Tell me what to do, I’m already tormented :(

    You can show the output of the command:
    sudo fdisk -l

    Vladimir:
    The only remark is the errors in the use of tsya/tsya. -TSYA or -TSYA? Thanks again. :)

    It could be ;) You'll need to bring it to your editor's attention ;)

  • Taras
    27 September, 06:59
  • Mut@NT
    30 September, 06:46

    Taras: The samba mount command does not work.

    What exactly doesn't work in it?

  • Roman
    2 November, 20:41

    What if the file system is LWM2, and Linux Mint complains?!
    that is, the command sudo mount -t lwm2 /dev/sdb /home/user/Video is not accepted.

  • zzzubr
    2 November, 22:52

    Mut@NT: sudo mount -t ext3 -o rw /dev/hda3 /home/roza/Desktop
    So? That is, the mount point is /home/roza/Desktop?

    If everything is mounted for you and the file system /dev/hda3 is visible, but you do not have enough rights, then you just need to add these rights:
    sudo chmod -R 0777 /home/roza/Desktop

    mmm... it seems to me... that this was not a very good way... it would be more correct to log in from root because this way you gave rights to everyone and everything... and this is not good...

    IMHO! even though they say that there are a million articles, it’s still a good article) but there aren’t enough examples... I’d like to see some non-standard applications... because with examples everything is easier to understand)
    29 November, 20:33

  • Mut@NT
    5 December, 19:34

    max: It was Windows, the hard drive was divided into 4 logical drives (c,d,e,f). I installed ubuntu 10.04 on drive “c”, thereby destroying Windows. Now I have no access and can’t see the others logical drives. Please tell me what to do to get access to them?

  • Ihor
    6 December, 14:41

    >
    >

  • Mut@NT
    14 December, 10:48

    Ihor:> Mounting hard sections disk
    > ...You can take any mount point.
    It seems that the Big Red Book (I also heard “by Nemeth”) says: “... it is advisable that there are no files in the folder where you are mounting, because they will not be visible.”

    Well, that goes without saying.

  • Cartoon
    7 January, 22:06

    Mounted iso image

    # sudo mount -t iso9660 -o loop /home/op/iso/1.iso /home/op/disk

    He writes Russian file names in cryptic language.

  • umnik
    29 March, 16:15

    There are a lot of articles and books, but this is the first time I’ve seen something humanly written, so to speak, shown and told, to the author, I found a little something for myself, but I couldn’t understand this little bit for several years. The author is worthy of respect; if such an article had fallen into my hands 7 years ago, when I began to surf the expanses of Linux, I would have been very happy.

    Everything has been told

  • Zlobik
    18 August, 08:09

    Please tell me how to clean the mount tails? Thank you.

  • Neon
    12 January, 23:29

    A funny thing happened to me here. I tried to make a bootable Windows flash drive. I formatted the flash drive with the mkfs command, then according to the recommendations of some “advanced” users. I installed the gparted application, gave the flash drive the bootable (active) flag... And after that, miracles began:
    1. problem: mount & umount commands disappeared
    2. We managed to restore the commands, but there’s another problem. When mounting a partition (no matter what system), the fs is connected in read mode, and access rights cannot be changed. The system simply does not respond to these command keys and says everything is fine, the operation was completed successfully.

    Conclusion I can pick up files from any media, but I can’t give files away. I read the article from fstab. I rewrote the file manually. I didn't make any more changes to it. But an attempt to mount a disk with write and execute rights still ended in failure. After I removed gparted and rebooted the system, the fstab file I edited began to work correctly and the mount commands were restored.

    Attention question: What is the reason for this behavior of gparted and how did it do it? Well, how to deal with this without deleting gparted?

  • Agatha
    21 January, 23:07

    Excellent, intelligible articles: this one, “.. SWAP in Linux”, “.. what is fstab?”!
    Dear author, please write a couple more, covering topics such as partitioning, disk partitioning, merging partitions, moving home to another partition.
    That would be a great collection!

  • Alexander
    7 April, 00:35

    Is it possible somehow source code get this miracle program

  • sbp
    29 June, 01:27

    Tell me what to do?
    I installed Ubuntu 12.04 a week ago. After some careless actions, the system crashed. The disk contains 250GB of information. LiveCD HDD sees, but does not start (gives an error). And there is no way to connect it. Here is the result (even in this version) -
    root@ubuntu:~# sudo mount -t ext4 -o force /dev/sda1 /
    mount: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error In some cases useful information can be found in syslog - try dmesg | tail or something like that

    I tried to restore the system using recommendations from websites, but to no avail. When booting from disk, indicates that the boot manager did not detect the operating system.
    Tell me what to do?, where to “run”?

  • cinema
    25 October, 23:50

    Good afternoon. There is a server for a film projector on Linux. It differs from the usual ones in that it has a built-in Digital Cinema program for showing films through a projector. The motherboard recently died, they replaced it and installed another one. Everything was reloaded. Now the server doesn't see portable hard SATA drive. it is connected using a sled to transfer films to the server (1 film weighs from 90 to 300 GB). Can you please tell me using the mount command so that he can see it? (power is supplied to the disk, all cables are connected, but still does not see the disk)