Linux как подключить ntfs

MountingWindowsPartitions

Ubuntu is capable of reading and writing files stored on Windows formatted partitions. These partitions are normally formatted with NTFS, but are sometimes formatted with FAT32. You will also see FAT16 on other devices.

General Considerations

Ubuntu will show files and folders in NTFS/FAT32 filesystems which are hidden in Windows. Consequently, important hidden system files in the Windows C:\ partition will show up if this is mounted. Since it is all-too-easy to accidentally modify or delete files which are essential for Windows, it is advisable to mount your Windows C:\ partition as seldom as possible, preferably not at all, or read-only by configuring /etc/fstab (see below). If you have data which you want to access regularly from both Windows and Ubuntu, it is better to create a separate data partition for this, formatted NTFS.

Whether you write to your Windows C:\ partition or a shared NTFS data partition, be aware that if you are using Windows 7, and Windows 7 is in a hibernated state when you write to the NTFS partition from Ubuntu, you will lose all your changes. This is because when Windows 7 is hibernated it writes the system state to a file stored on disk and restores from that file when the system is re-awakened, thus restoring the whole fileystem to a state before any changes made from Ubuntu. In Windows 7 you must avoid using hibernation. With Windows 8, the situation is more complex in that, by default, it uses a hybrid hibernation/shutdown when you shut the system down. Any changes made by Ubuntu will be lost when you reboot into Ubuntu.

With both Windows 7 and Windows 8 (when installed to a legacy mbr partition table) there is usually a 100-200MB boot partition labelled «SYSTEM». Do not mount it — you do not need to. Similarly it is highly advisable to leave any recovery partitions unmounted.

Using the File Manager

For those using a desktop version of Ubuntu, or one of its offical derivatives, the easiest and quickest way of mounting NTFS or FAT32 partitions is from the file manager: Nautilus in Ubuntu, Thunar in Xubuntu, Dolphin in Kubuntu and PCManFM in Lubuntu. Simply look in the left pane of the file manager for the partition you wish to mount and click on it — it will be mounted and its contents will show up in the main pane. Partitions show with their labels if labelled, or their size if not.

Unless you require your Windows partition — or a NTFS/FAT32 partition for data shared with Windows — mounted every time you boot up for one of the reasons given below, mounting from the file manager in this way should suffice.

Читайте также:  Торговое оборудование 1с linux

If you are using a Wubi version of Ubuntu and you wish to browse the host partition, you do not need to mount it — it is mounted already in the «host» folder. Click on «File System» in the left pane of the Nautilus file browser and then open the host folder which you will see in the main pane.

File System Differences

  • Windows 7, Vista, XP, 2000, older NT systems, and Windows Server 2003 and 2008 are formatted with NTFS. In rare cases, OEM manufacturers have pre-installed Windows XP and Windows 2000 to FAT32 filesystems.
  • Older versions of Windows such as Windows ME, 98, and 95 are formatted with FAT32.
  • Flash drives, such as a USB thumb drive or a camera’s flash card are typically formatted as FAT16. Some Flash drives are formatted with Microsoft’s proprietary exFAT file system.

NTFS

The ntfs-3g driver is used in Linux-based systems to read from and write to NTFS partitions.

NTFS (New Technology File System) is a file system developed by Microsoft and used by Windows computers (Windows 2000 and later). Until 2007, Linux distros relied on the kernel ntfs driver which was read-only. The userspace ntfs-3g driver now allows Linux-based systems to read from and write to NTFS formatted partitions.

The ntfs-3g driver is pre-installed in all recent versions of Ubuntu and healthy NTFS devices should work out of the box without further configuration. In Ubuntu versions 11.10 and later the ntfs-3g package included the functionality previously provided by ntfsprogs. Trying to install ntfsprogs in 11.10 (and possibly in 12.04) will cause the package-manager to ask if you wish to remove ntfs-3g. Users who have installed ntfsprogs and failed to notice the message from the package manager have unintentionally uninstalled ntfs-3g, after which the system falls back to the read-only kernel ntfs driver. Loss of the ntfs-3g driver for similar reasons has also been reported when upgrading from 11.04 to 11.10. If you are experiencing inability to write to a NTFS formatted partition or device, check whether or not the ntfs-3g package is installed.

FAT32

The vfat driver is used in linux to read and write FAT32 and FAT16 partitions.

Configuring /etc/fstab

Preface

  • Convenience.
  • Where more than one user account is in use during a session. Partitions mounted from one user account by means of the file manager are not accessible to the other account(s).
  • Where libraries have been set up in applications such as Banshee or Rhythmbox (for music) or Shotwell (for photos). If those libraries contain files on partitions mounted by means of the file manager, an error will occur in a subsequent session if the partition is not mounted first.
  • Where more advanced or special mount options are needed. Three working configurations for different needs are given below, but anything more advanced is beyond the scope of this wiki page. The NTFS-3G manual gives a list of mount options suitable for NTFS filesystems.
Читайте также:  Microsoft разработал свой linux

Automatic Configuration

Although there are a number of GUI applications available from the Ubuntu Software Centre, none of these can be recommended at the time of this writing, unfortunately. They are obsolete and unmaintained and can all cause problems. Two examples are ntfs-config and PySDM. (PySDM is no longer in the repository with effect from 12.10.) If you find a recommendation anywhere for either of these applications, it is likely to be an old one, and should not be followed. At this time it is advisable to configure /etc/fstab manually.

Manual Configuration

/dev/sda1: LABEL="Recovery" UUID="B23613F43613B875" TYPE="ntfs" /dev/sda2: LABEL="Windows" UUID="38CE9483CE943AD8" TYPE="ntfs" /dev/sda3: LABEL="Data" UUID="519CB82E5888AD0F" TYPE="ntfs" /dev/sda5: UUID="00d7d951-2a35-40fd-8e5d-411bb824ff3b" TYPE="swap" /dev/sda6: LABEL="Ubuntu" UUID="6044b1d0-208e-4ab3-850d-03a92e1516fc" TYPE="ext4"

The first three partitions, all NTFS, are the ones that concern us here. There are no FAT32 partitions. In this instance, all three NTFS partitions have partition labels, which makes it easier to identify the purpose of each. If your blkid output does not include partition labels, this means that the partitions do not have labels and you will have to determine which partition you wish to mount by another means. Of the three NTFS partitions, we are going to configure /etc/fstab with only the third, the Data partition. Partition /dev/sda1 is the OEM manufacturer’s recovery partition and should be left unmounted, or as described below. Partition /dev/sda2 is the Windows C:\ partition and is best not included in /etc/fstab for the reasons described above, or mounted read-only — see below.

In this case we have created a mountpoint with the same name – Data – as the partition label. You may use (almost) any string you wish.

sudo cp /etc/fstab /etc/fstab.orig
UUID=519CB82E5888AD0F /media/Data ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0

Replace the UUID with the one relevant for your partition as shown in your blkid output. “519CB82E5888AD0F” will not work for you.

Also, substitute your mountpoint for “/media/Data”. In case you have a blank space in the name of the mountpoint you want to use like «New Volume» instead of «Data» located in «/media» use «/media/New\040Volume». The space character is created by using «\040» in the fstab.

Two special cases

Sample /etc/fstab lines are suggested for two special cases.

UUID=519CB82E5888AD0F /media/Data ntfs defaults,umask=222 0 0
UUID=519CB82E5888AD0F /mnt/Data ntfs noauto,umask=222 0 0

Note: with these mount options, the partition does not appear in the Devices list in the left pane of Nautilus (the Ubuntu file manager), but it still appears in Dolphin, the Kubuntu File Manager. Clicking on the partition in Dolphin causes the display of an error message. This solution is less elegant in Dolphin than with Nautilus, but the desired effect is achieved — the partition cannot be mounted.

sudo mv /etc/fstab.orig /etc/fstab sudo umount /media/

Читайте также:  Linux shell script no output

Substitute your mountpoint in the second line.

FAT32 Partition

UUID= /media/ vfat defaults,user,exec,uid=1000,gid=100,umask=000 0 0

Replace with the UUID that blkid reveals for your partition, and adjust for your mountpoint. These mount options will make all files in the partition executable. If you have other needs, you will need to modify the options, but this is beyond the scope of this wiki page.

Other Resources

IconsPage/resources.png

  • ntfs-3g homepage
  • Fstab
  • LinuxFilesystemsExplained
  • How to fstab
  • CategoryBootAndPartition

Footnote

This page has recently been subject to significant revision. If you have any comments about current content, or suggestions for further additions or edits, please head over to this Ubuntu forums discussion thread so that we can co-ordinate our efforts.

MountingWindowsPartitions (последним исправлял пользователь ip68-106-25-73 2014-11-16 06:31:46)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Как монтировать нестандартные файловые системы в Linux

Обновлено

Обновлено: 09.07.2023 Опубликовано: 09.08.2016

Данную инструкцию можно рассматривать как шпаргалку для работы с некоторыми файловыми системами в системах Linux. По мере возможности, список примеров будет пополняться.

NTFS

Установка компонентов

Для начала необходимо установить пакет ntfs-3g. В противном случае, при попытке запустить команду на монтирование раздела NTFS мы получим ошибку mount: unknown filesystem type ‘ntfs’.

Сначала устанавливаем расширенный репозиторий:

Затем сам пакет ntfs-3g

После установки данного пакета в системе появятся дополнительные команды mount.ntfs-fuse и mount.ntfs-3g., а также команда mount распознает опцию -t ntfs.

Ручное монтирование

Монтирование NTFS на чтение и запись выполняется любой из трех команд:

mount -t ntfs-3g /dev/sdb1 /mnt

* в данном примере, примотировано устройство /dev/sdb1 в раздел /mnt. Понять, какой устройство нужно монтировать можно при помощи команды fdisk -l

Автоматическое монтирование

Чтобы раздел автоматически монтировался при перезапуске компьютера, открываем на редактирование файл:

/dev/sdb1 /mnt ntfs defaults 0 0

* в данном примере мы раздел /dev/sdb1 будем монтировать в каталог /mnt.

Чтобы применить настройку и проверить ее, вводим:

Посмотреть примонтированные разделы и файловые системы можно командой:

GeeseFS (Yandex Cloud диск)

Установка компонентов

Сначала устанавливаем утилиты fuse и wget. В зависимости

yum install fuse fuse3 wget

Скачиваем geesefs и сохраняем ее в /usr/bin/geesefs:

wget https://github.com/yandex-cloud/geesefs/releases/latest/download/geesefs-linux-amd64 -O /usr/bin/geesefs

Выставляем разрешение утилиты geesefs на запуск:

Проверяем работу утилиты, посмотрев ее версию:

Мы должны увидеть что-то на подобие:

Авторизация

Yandex Cloud для монтирования диска требует прохождение аутентификации с помощью токена. Его мы получаем в личном кабинете хостера.

Для настройки доступа создаем каталог .aws в домашней директории пользователя, под которым будем монтировать диск. В моем случае, пользователь root:

После создаем файл с токеном:

[default]
aws_access_key_id = H. D
aws_secret_access_key = H. 7

Ручное монтирование

Для монтирования используем команду geesefs:

Автоматическое монтирование

Чтобы раздел автоматически монтировался при перезапуске компьютера, открываем на редактирование файл fstab:

fuse.geesefs _netdev,allow_other,—file-mode=0666,—dir-mode=0777 0 0

Если мы хотим, чтобы точке монтирования назвачался определенный владелец и группы, указываем опции uid и gid:

fuse.geesefs _netdev,allow_other,—file-mode=0666,—dir-mode=0777,—uid=1024,—gid=1024 0 0

Чтобы применить настройку и проверить ее, вводим:

Источник

Оцените статью
Adblock
detector