All about mount. Mounting file systems

The mount command is the one-stop tool that allows you to do everything you need. To view a list of mounted devices,

we enter it without arguments (root rights are not required to read):

/dev/sdal on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) none on /sys type sysfs (rw,noexec,nosuid,nodev) none on / sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw)

none on /sys/kernel/security type securityfs (rw) none on /dev type devtmpfs (rw,mode=0755)

none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev)

none on /var/run type tmpfs (rw,nosuid,mode=0755)

none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc

(rw,noexec, nosuid,nodev)

gvfs-fuse-daemon on /home/grinder/.gvfs type fuse.gvfs-fusedaemon (rw,nosuid,nodev,user=grinder)

As a result, we get a list, in the first position of which the source resource is indicated, in its place it can be none (a system resource) or, as in our case, the gvfs-fuse-daemon program. On the second - the point where it is mounted.

NOTE

A similar list can be obtained by reading the contents of the /etc/mtab.

To mount a partition or other resource using mount, in the simplest case, it is enough to specify its name and mount point. For example, partition /dev/sdb2

should be connected to /home/grinder/audio:

$ sudo mount /dev/sdb2 /home/grinder/audio

Now by going to /home/grinder/audio we can work with the files inside. But often the default mount options are not very convenient.

Look full information about the disk partition - available volume, free space - you can use the df-h command.

The file system is usually determined automatically, but if there are logical errors on the partitions of the connected hard disk, then you must additionally specify the type of the file system using the -t switch:

$ sudo mount -t ext3 /dev/sdb2 /home/grinder/audio

In the example, the ext3 file system type is selected. Other filesystems are mounted with the following options:

T ext2, -t ext3, -t ext4, -t reiser, -t xfs - mount partitions with corresponding file systems;

T ntfs-3g - mount an NTFS partition;

T vfat - mount a FAT32 partition;

T iso9660 - mount a CD drive or ISO image;

T smbfs or -t cifs to mount a Windows system resource.

You can find out which file systems are supported by a distribution by looking at the output of the dmesg command or by looking at the list of mount.* executables. The latter is very easy to do: type mount in the terminal. and press the tab key.

For a complete list of all possible -t values, see man mount.

Mounting Partitions

Access options to the mounted partition are specified using the -o flag. The -o rw flag is specified for read/write access, and -o ro for read-only access. Let's allow reading and writing in our example:

$ sudo mount -t ext3 -o rw /dev/sdb2 /home/grinder/audio

NOTE

Partition access options are specified in the last position of the output of the mount command.

But depending on the kernel build, the encoding of filenames typed in Latin characters in the mounted partition may be unreadable. Let's specify it explicitly:

$ sudo mount -t ext3 -o rw,iocharset=utf8,codepage=866 /dev/sdb2

/home/grinder/audio

The -o iocharset=utf 8 parameter explicitly sets the system locale encoding, in Linux Mint it is ut f 8, and codepage=8 66 adds support for the Russian language encoding.

The -o force option allows you to force the mounting of hard disk partitions if, for unspecified reasons, the mount utility refuses to mount it with the usual options.

A CD inserted into the drive is also mounted automatically. You can manually mount it like this:

$ sudo mount -t iso9660 -o ro /dev/cdrom /mnt

Ho mount is also interesting because it allows you to mount ISO disk images.

To do this, in addition to the file system type, we also specify the -o loop parameter.

$ sudo mount -t iso9660 -o loop ~/file.iso /home/iso

To unmount a partition, just specify either a device or a mount point:

$ sudo umount /dev/sdb2

$ sudo umount /home/grinder/audio

The network drive is mounted in the same way - we specify its network name and mount point. Additionally, you can set a username and password for access. If this is not done, then the password will be requested at the time of connection, and the login will be taken by the current one under which the user works. But first we need to install the smbfs package:

$ sudo aptitude install smbfs

Now we enter

$ sudo mount -t smbfs -o isegpache=login,password=password //server/Video /home/grinder/video

NOTE

Instead of a name, you can specify the IP address of the system.

In Linux, the mount command is used to mount (mount) file systems and portable drives (such as USB flash drives) to specific mount points in a directory tree. The umount command unmounts (unmounts) a mounted filesystem from a directory tree. In this tutorial, we will cover the basics of mounting and unmounting various file systems using the mount and umount commands.

Displaying a list of mounted file systems (FS)

When executed without arguments, the mount command will list all currently mounted file systems:

$ mount

By default, the result will contain all file systems, including virtual ones, such as cgroup, sysfs, etc. Each line contains information about the device name, directory in which it is mounted, type and mount options in the following form:

device_name on directory type filesystem_type (options)

To display only filesystems of a certain type, use the -t option. For example, only ext4 partitions can be displayed like this:

$mount -t ext4

Mounting the file system

To mount a file system to a specific location (mount point), the mount command is used in the following form:

Mount [options...] device_name directory

Once connected, the mount point becomes the root directory of the mounted file system. For example, you can mount the /dev/sdb1 hard drive to the /mnt/media directory as follows:

$ sudo mount /dev/sdb1 /mnt/media

Usually, when mounting a device with a common FS, such as ext4 or xfs, the mount command automatically determines its type. However, some FS are not recognized. Their type must be specified explicitly. To do this, use the -t option:

Mount -t type devicename directory

To specify additional mount options, the -o flag is used:

Mount -o mount_options device_name dir

You can specify multiple options separated by commas (there must be no spaces after the commas). Below are the main command options

-V— display the version of the utility;
-h- issue a certificate;
-v— detailed mode;
-a,all- mount all devices described in fstab;
-F, --fork- create a separate mount instance for each separate section;
-f, --fake- do not perform any actions, but only see what the utility is going to do;
-n, --no-mtab- do not write mounting data to /etc/mtab;
-l, --show labels— add a disk label to the mount point;
-c- use only absolute paths;
-r, --read-only— mount a read-only partition;
-w, -rw- mount for reading and writing;
-L, --label— mount partition by label;
-U, -uuid— mount partition by UUID;
-T, --fstab- use an alternative fstab;
-B, --bind— mount a local folder;
-R, --rbind- remount the local folder.

A complete list of options can be obtained by running the command man mount.

mount usage examples

Let's look at a few examples of using the utility. As a rule, only two steps are required to mount

  1. Create mount point
  2. Mount file system

Mounting a USB Flash Drive/Hard Drive

In most modern Linux distributions, such as Ubuntu, USB drives are automatically mounted when connected, but sometimes you may need to manually mount the device. To mount a USB drive, follow these steps:

Create a mount point

sudo mkdir -p /media/usb

If the USB drive uses /dev/sdd1, it can be mounted to the /media/usb directory with the following command:

sudo mount /dev/sdd1 /media/usb

You can use any of the following commands to search for the device and file system type:

  • ls -l /dev/disk/by-id/usb*
  • dmesg
  • lsblk

Mounting ISO files

To mount an ISO file, a loop device is used - a special virtual device that allows you to access the file as a block device.

First you need to create a mount point in any desired directory:

Sudo mkdir /media/iso

Mount the ISO file with the following command:

sudo mount /path/to/image.iso /mnt/iso -o loop

Don't forget to replace /path/to/image.iso with the path to your ISO file.

NFS mount

Mounting an NFS system requires an NFS client to be installed. Installing the NFS client on Ubuntu and Debian:

sudo apt install nfs-common

Installing the NFS client on CentOS and Fedora:

sudo yum install nfs-utils

Create a directory that will be the mount point of the remote file system:

Sudo mkdir /media/nfs

Usually you want to automatically mount a remote NFS directory on boot. To do this, you need to change the configuration file /etc/fstab. Open it with any text editor, for example:

sudo nano /etc/fstab

Add the following line to the file, replacing server:/dir with the name or IP address of the NFS server and the export directory:

#

Server:/directory /media/nfs nfs defaults 0 0

Mount the NFS share with the following command:

sudo mount /mnt/nfs

sudo mount -a

Unmounting the file system

To unmount a mounted file system, use the umount command, the argument of which is the directory into which it was mounted (mount point) or the device name:

umount directory umount device_name

If the filesystem is in use, umount will not be able to unmount it. In such situations, you can use the fuser command to find out which processes are accessing the file system:

Fuser -m directory

Once you have identified the processes, you can stop them and unmount the file system. You can also use the -l option (--lazy, “lazy” shutdown) to dismount a busy file system immediately after its use is complete:

Umount -l directory

To force unmount, use the -f (--force) option. It is typically used to disable an unreachable NFS system.

Umount -f directory

In all other cases, forced shutdown is undesirable, as it can lead to data corruption in the file system.

Preserve mount options after reboot

In order for devices to be mounted automatically when the system is rebooted, you need to write mount instructions in the /etc/fstab file. The /etc/fstab file contains a list of entries in the following format:

[File system] [Mount point] [File system type] [Options] [Pass number]

For example:

/dev/sdb1 /home ext4 defaults 0 0

After the instructions for mount are written in /etc/fstab, to check the spelling, issue the command

Mount-a

If the command works without errors, then all devices registered in /etc/fstab will be connected, and the changes will not be lost after reboot.

Conclusion

We have looked at the most common examples of attaching various file systems to a directory tree using the mount command and disabling them with the umount command. For more information about the options for the mount and umount commands, see the respective man pages.

If you find an error, please highlight a piece of text and click Ctrl+Enter.

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

Why do it by hand when modern Linux desktop systems do it automatically?


There are some cases where the system linux cannot automatically mount/mount the disk due to some logical disk failures, viruses that infect NTFS/FAT partitions, or because of something else anomalous. To do this, real system administrators do it by hand. And they do it with the mount command.

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

This article is not a complete, exhaustive description of the mount command (a complete description of the mount command can be found by running the command man mount in the console), but strive to do so. The article on the description of the mount command is constantly being finalized and modified. All suggestions for the article can be left in the comments.

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 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 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

Load Device 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 media: /dev/sdc

Viewing mounted devices is carried out with the command:

After that, 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 says that the root FS is reiserfs file system with mount options: read and write access (rw)
  • /dev/sda3 is the /home disk partition
  • /dev/sdc is a mounted removable USB device

Mounting hard disk partitions

Top

From the above example, you can see that the /dev/sdb hard drive is connected but not mounted. Mount the /dev/sdb1 hard disk partition to the /dev/sda disk. Select a mount point, for example - /home/user/Video. You can take any mount point.

# sudo mount /dev/sdb1 /home/ user/Video

where user is the name of your username.

Everything is very simple, first the mount command is written, then what needs to be attached is written (the number shows the partition number, we have only one), and then where to attach it. Almost always this is enough. The disk, with the mount command, is mounted to the specified folder. In some cases, when there are logical errors on the partitions of the connected hard disk, you must additionally specify the file system type. In this case, we have ext3.

# sudo mount -t ext3 /dev/sdb1 /home/ user/Video

This parameter can also take the following values:

  • -t ntfs or -t ntfs-3g
  • -t vfat
  • -t iso9660

Respectively for NTFS, FAT and CD-ROM file systems. The latter is needed only for connecting CD / DVD-ROM devices and the .iso disk image.

To manually set access parameters to a mounted partition, specify the parameter:

  • -o rw
  • -o ro

The first allows reading and writing, the second only reading. Well, for example, like this:

# sudo mount -t ext3 -o rw /dev/sdb1 /home/user/Video

Additional options that help in some cases:

# sudo mount -t ext3 -o rw,iocharset=utf8,codepage=866 /dev/sdb1 /home/user/Video

The first explicitly sets the encoding of the system locale, in our case it is utf8 (it has its own for different distributions, but more often utf8), and the other adds support for the Russian language.

If, nevertheless, the hard drive refuses to be mounted in the Linux operating system, then you can mount it manually. Parameter -o force allows you to force mount hard disk partitions in Linux. Well, for example, like this:

# sudo mount -t ext3 -o force /dev/sdb1 /home/user/Video

For example, I had a hard disk partition that 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 into the root of my partition and Linux did not want to mount this partition because of this. The above mount command option helped to mount the infected partition. Then the virus was successfully removed manually.

There is a unique opportunity in Linux to specify a folder mirror, which receives all the rights and actions available on the folder. Let's say the /dev/sdb1 partition is also used to store documents. Mirror it in /home/user/Documents:

# sudo mount --bind /home/user/Videos /home/user/Documents

The action of the mount --bind command is similar to DOS subst.

You can view full information (available disk space, free space) about mounted devices with the command:

Unmounting devices is done with the command:

# sudo umount /dev/sdb1

or

# sudo umount /home/user/Video

Mounting CD/DVD-ROMs

Top

If you need to mount a CD/DVD-ROM, then mounting the CD/DVD-ROM is done in exactly the same way, using the same mount command that was given above:

# sudo mount -t iso9660 -o ro /dev/cdrom /cd

Only when mounting a CD-ROMyou need to specify the iso9660 file system type.

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

Why do it by hand when modern Linux desktop systems do it automatically?

There are some cases where the system linux cannot automatically mount/mount the disk due to some logical disk failures, viruses that infect NTFS/FAT partitions, or because of something else anomalous. To do this, real system administrators do it by hand. And they do it with the mount command.

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

This article is not a complete, exhaustive description of the mount command (a complete description of the mount command can be found by running the command man mount in the console), but strive to do so. The article on the description of the mount command is constantly being finalized and modified. All suggestions for the article can be left in the comments.

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 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 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

Load Device 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 media: /dev/sdc
Viewing mounted devices is carried out with the command:

After that, 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 says that the root FS is reiserfs file system with mount options: 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 Linux systems, the file is /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's $HOME/.dmrc file has incorrect permissions and is ignored. This prevents the session and default language from being saved. This file must be owned by a 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 here I can’t use either sudo or just su - the terminal swears not in Russian. Is it possible to restore the rights to ($HOME). Can I do this using the Mint live disk?

  • [email protected]
    29 March, 12:13

    Hummingbird: Then everything freezes for a few seconds and the desktop opens. And here I can’t use either sudo or just su - the terminal swears not in Russian. Is it possible to restore the rights to ($HOME). Can I do this using the 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
    April 2, 08:43
  • [email protected]
    April 3, 13:39

    Hummingbird: All the same, nothing happened :(. In general, I reinstalled the partition with mint. The main thing is that I learned how to mount partitions (I understood how to do it, then it's easier) And I also learned a lesson for myself - you need to distribute rights very carefully. In any case, thanks!

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

  • Alex Under Construction
    19 May, 08:41

    Thank you.
    A couple of extras.
    1. For example, my hard disk 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 into the root of my partition and Linux did not want to mount this partition because of this.
    I didn’t want to mount it not because of autorun.exe, but because most likely the Windows were extinguished “incorrectly” and the byte about checking the integrity of the file system remained on ntfs. In this regard, ntfs3g without “force” is afraid to mount such a file system, 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/

  • unimportant
    May 20, 15:26
  • Tonik
    24 May, 03:04
  • [email protected]
    26 May, 17:27

    Alex Under Construction: Thank you. A couple of extras. 1. For example, my hard disk 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 into the root of my partition and Linux did not want to mount this partition because of this. I didn’t want to mount it not because of autorun.exe, but because most likely the Windows were extinguished “incorrectly” and the byte about checking the integrity of the file system remained on ntfs. In this regard, ntfs3g without “force” is afraid to mount such a file system, 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 mount was also described

    Thanks for the comment. I'll make additions.

    tonic: But the article helped me. Elementary! - I forgot how to mount ... I quickly ran through the article, and remembered. Thanks a lot to the author!

    Come back often :)

  • Denis
    11 June, 11:47

    Thank you for the article,
    och. intelligibly

  • Ludmila
    July 9, 13:05

    # 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 team is wrong?

  • [email protected]
    July 9, 22:11

    Ludmila:# sudo mount -t smbfs -o username=vasja,password=pupkin //pupkin_v/Video /home/user/video doesn't work, gives help usage: …… working 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, there are nuances and differences between the Russian and English Windows OS

  • Andrei
    31 August, 10:04

    In ubuntu you need this:
    mount -t cifs -o username=tridge,password=foobar //fjall/test /mnt/smb/fjall

  • CJ
    14 September, 20:28

    [email protected]:~$ sudo umount /dev/sda1
    umount: /:device is busy. (In some useful cases info about processes that use the device is found by lsof(8) or fuser(1))
    [email protected]:~$ df -h
    File system Size Use Ext Use% is 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
  • [email protected]
    19 September, 20:14

    CJ: The /dev/sda1 drive needs to be mounted, but it claims to be already mounted at “/”, even though Ubuntu's system partition is mounted at that point. 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 use errors tsya / tsya.-TSYA or -TSYA? Thanks again.:)

    It could be ;) Will need to get the attention of your editor ;)

  • Taras
    27 September, 06:59
  • [email protected]
    30 September, 06:46

    Taras: The samba mount command does not work.

    What exactly does not work in it?

  • Roman
    November 2, 20:41

    And if the file system is LWM2, and Linux Mint swears?!
    i.e. the command sudo mount -t lwm2 /dev/sdb /home/user/Video is not accepted.

  • zzzubr
    November 2, 22:52

    [email protected]: sudo mount -t ext3 -o rw /dev/hda3 /home/roza/Desktop
    So? So the mount point is /home/roza/Desktop?

    If everything is mounted for you and the /dev/hda3 file system 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 it was not a very good way ... it would be more correct to enter from the root, because in this way you gave rights to everyone and everything ... and this is not good ...

    IMHO! although they say that there are a million articles, anyway, the article is good) though there are not enough examples ... I would like to see some non-standard chtoli applications ... because everything is easier to digest by examples)
    November 29, 20:33

  • [email protected]
    5 December, 19:34

    max: It was Windows, the hard drive was divided into 4 logical disks (c, d, e, f). I installed ubuntu 10.04 on the “c” drive, thereby demolishing Windows. Now there is no access and I can not see the rest of the logical drives. Please tell me what to do to get access to them?

  • Ihor
    6 December, 14:41

    >
    >

  • [email protected]
    14 December, 10:48

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

    Well, it 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

    Writes Russian file names with krakozyabry.

  • umnik
    29 March, 16:15

    there are a lot of articles and books, but I see it for the first time, humanly written, so to speak, on the fingers, shown and told, many thanks to the author, I found a bit for myself, but I couldn’t understand and find this bit for several years. The author is worthy of respect, if such an article fell into my hands about 7 years ago, when I started to surf the expanses of Linux, I would be very happy.

    All told

  • Zlobik
    18 August, 08:09

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

  • neon
    12 January, 23:29

    A funny thing happened to me here. Tried to make a bootable USB flash drive. formatted the flash with the mkfs command, then according to the recommendations of some “advanced” users. installed the gparted application, gave the flash drive a bootable (active) flag ... And after that miracles began:
    1. the problem is that the mount & umount commands have disappeared
    2. The team was restored, but there is another trouble. when mounting a partition (no matter with which system), the fs is connected in read mode, it is not possible to change access rights. The system simply does not respond to these command keys and says everything is in order, the operation was successful.

    Conclusion I can pick up files from any medium, I can’t give files. I read the article with fstab. Rewrote the file by hand. Didn't make any more changes to it. But an attempt to mount a disk with write and execute permissions still failed. After I demolished gparted and rebooted the system, the fstab file I edited began to work correctly and the mount commands were restored.

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

  • Agatha
    21 January, 23:07

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

  • Alexander
    7 April, 00:35

    Is it possible to somehow get the source code of this miracle program

  • sbp
    29 June, 01:27

    Tell me what to do?
    Installed Ubuntu12.04 a week ago. After some careless actions, the system crashed. There is 250GB of information on the disk. LiveCD HD sees, but does not start (gives an error). And there is no way to connect it. Here is the result (even in this variant) −
    [email protected]:~# 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 the syslog - try dmesg | tail or something like that

    I tried to restore the system performance according to the recommendations from the sites, but to no avail. When booting from disk, indicates that the boot manager did not detect an 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. differs from the usual ones in that it has a Digital Cinema program for showing films through a projector. The motherboard recently died, changed, put another one. Everything has been reloaded. Now the server does not see the portable SATA hard drive. it is connected using a sled to transfer movies to the server (1 movie weighs from 90 to 300 GB). Tell me, plz, through the mount command, can I make it so that he would see it? (power is supplied to the disk, all loops are connected, but it still does not see the disk)

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

    Why do it by hand when modern Linux desktop systems do it automatically?

    There are some cases where the system linux cannot automatically mount/mount the disk due to some logical disk failures, viruses that infect NTFS/FAT partitions, or because of something else anomalous. To do this, real system administrators do it by hand. And they do it with the mount command.

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

    This article is not a complete, exhaustive description of the mount command (a complete description of the mount command can be found by running the command man mount in the console), but strive to do so. The article on the description of the mount command is constantly being finalized and modified. All suggestions for the article can be left in the comments.

    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 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 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

    Load Device 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 media: /dev/sdc
    Viewing mounted devices is carried out with the command:

    After that, 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 says that the root FS is reiserfs file system with mount options: 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 Linux systems, the file is /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's $HOME/.dmrc file has incorrect permissions and is ignored. This prevents the session and default language from being saved. This file must be owned by a 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 here I can’t use either sudo or just su - the terminal swears not in Russian. Is it possible to restore the rights to ($HOME). Can I do this using the Mint live disk?

  • [email protected]
    29 March, 12:13

    Hummingbird: Then everything freezes for a few seconds and the desktop opens. And here I can’t use either sudo or just su - the terminal swears not in Russian. Is it possible to restore the rights to ($HOME). Can I do this using the 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
    April 2, 08:43
  • [email protected]
    April 3, 13:39

    Hummingbird: All the same, nothing happened :(. In general, I reinstalled the partition with mint. The main thing is that I learned how to mount partitions (I understood how to do it, then it's easier) And I also learned a lesson for myself - you need to distribute rights very carefully. In any case, thanks!

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

  • Alex Under Construction
    19 May, 08:41

    Thank you.
    A couple of extras.
    1. For example, my hard disk 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 into the root of my partition and Linux did not want to mount this partition because of this.
    I didn’t want to mount it not because of autorun.exe, but because most likely the Windows were extinguished “incorrectly” and the byte about checking the integrity of the file system remained on ntfs. In this regard, ntfs3g without “force” is afraid to mount such a file system, 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/

  • unimportant
    May 20, 15:26
  • Tonik
    24 May, 03:04
  • [email protected]
    26 May, 17:27

    Alex Under Construction: Thank you. A couple of extras. 1. For example, my hard disk 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 into the root of my partition and Linux did not want to mount this partition because of this. I didn’t want to mount it not because of autorun.exe, but because most likely the Windows were extinguished “incorrectly” and the byte about checking the integrity of the file system remained on ntfs. In this regard, ntfs3g without “force” is afraid to mount such a file system, 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 mount was also described

    Thanks for the comment. I'll make additions.

    tonic: But the article helped me. Elementary! - I forgot how to mount ... I quickly ran through the article, and remembered. Thanks a lot to the author!

    Come back often :)

  • Denis
    11 June, 11:47

    Thank you for the article,
    och. intelligibly

  • Ludmila
    July 9, 13:05

    # 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 team is wrong?

  • [email protected]
    July 9, 22:11

    Ludmila:# sudo mount -t smbfs -o username=vasja,password=pupkin //pupkin_v/Video /home/user/video doesn't work, gives help usage: …… working 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, there are nuances and differences between the Russian and English Windows OS

  • Andrei
    31 August, 10:04

    In ubuntu you need this:
    mount -t cifs -o username=tridge,password=foobar //fjall/test /mnt/smb/fjall

  • CJ
    14 September, 20:28

    [email protected]:~$ sudo umount /dev/sda1
    umount: /:device is busy. (In some useful cases info about processes that use the device is found by lsof(8) or fuser(1))
    [email protected]:~$ df -h
    File system Size Use Ext Use% is 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
  • [email protected]
    19 September, 20:14

    CJ: The /dev/sda1 drive needs to be mounted, but it claims to be already mounted at “/”, even though Ubuntu's system partition is mounted at that point. 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 use errors tsya / tsya.-TSYA or -TSYA? Thanks again.:)

    It could be ;) Will need to get the attention of your editor ;)

  • Taras
    27 September, 06:59
  • [email protected]
    30 September, 06:46

    Taras: The samba mount command does not work.

    What exactly does not work in it?

  • Roman
    November 2, 20:41

    And if the file system is LWM2, and Linux Mint swears?!
    i.e. the command sudo mount -t lwm2 /dev/sdb /home/user/Video is not accepted.

  • zzzubr
    November 2, 22:52

    [email protected]: sudo mount -t ext3 -o rw /dev/hda3 /home/roza/Desktop
    So? So the mount point is /home/roza/Desktop?

    If everything is mounted for you and the /dev/hda3 file system 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 it was not a very good way ... it would be more correct to enter from the root, because in this way you gave rights to everyone and everything ... and this is not good ...

    IMHO! although they say that there are a million articles, anyway, the article is good) though there are not enough examples ... I would like to see some non-standard chtoli applications ... because everything is easier to digest by examples)
    November 29, 20:33

  • [email protected]
    5 December, 19:34

    max: It was Windows, the hard drive was divided into 4 logical disks (c, d, e, f). I installed ubuntu 10.04 on the “c” drive, thereby demolishing Windows. Now there is no access and I can not see the rest of the logical drives. Please tell me what to do to get access to them?

  • Ihor
    6 December, 14:41

    >
    >

  • [email protected]
    14 December, 10:48

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

    Well, it 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

    Writes Russian file names with krakozyabry.

  • umnik
    29 March, 16:15

    there are a lot of articles and books, but I see it for the first time, humanly written, so to speak, on the fingers, shown and told, many thanks to the author, I found a bit for myself, but I couldn’t understand and find this bit for several years. The author is worthy of respect, if such an article fell into my hands about 7 years ago, when I started to surf the expanses of Linux, I would be very happy.

    All told

  • Zlobik
    18 August, 08:09

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

  • neon
    12 January, 23:29

    A funny thing happened to me here. Tried to make a bootable USB flash drive. formatted the flash with the mkfs command, then according to the recommendations of some “advanced” users. installed the gparted application, gave the flash drive a bootable (active) flag ... And after that miracles began:
    1. the problem is that the mount & umount commands have disappeared
    2. The team was restored, but there is another trouble. when mounting a partition (no matter with which system), the fs is connected in read mode, it is not possible to change access rights. The system simply does not respond to these command keys and says everything is in order, the operation was successful.

    Conclusion I can pick up files from any medium, I can’t give files. I read the article with fstab. Rewrote the file by hand. Didn't make any more changes to it. But an attempt to mount a disk with write and execute permissions still failed. After I demolished gparted and rebooted the system, the fstab file I edited began to work correctly and the mount commands were restored.

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

  • Agatha
    21 January, 23:07

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

  • Alexander
    7 April, 00:35

    Is it possible to somehow get the source code of this miracle program

  • sbp
    29 June, 01:27

    Tell me what to do?
    Installed Ubuntu12.04 a week ago. After some careless actions, the system crashed. There is 250GB of information on the disk. LiveCD HD sees, but does not start (gives an error). And there is no way to connect it. Here is the result (even in this variant) −
    [email protected]:~# 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 the syslog - try dmesg | tail or something like that

    I tried to restore the system performance according to the recommendations from the sites, but to no avail. When booting from disk, indicates that the boot manager did not detect an 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. differs from the usual ones in that it has a Digital Cinema program for showing films through a projector. The motherboard recently died, changed, put another one. Everything has been reloaded. Now the server does not see the portable SATA hard drive. it is connected using a sled to transfer movies to the server (1 movie weighs from 90 to 300 GB). Tell me, plz, through the mount command, can I make it so that he would see it? (power is supplied to the disk, all loops are connected, but it still does not see the disk)

  • Share