Ntfs ������ �� linux

NTFS-3G

NTFS-3G is an open source implementation of Microsoft NTFS that includes read and write support (the Linux kernel only supports reading NTFS). NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.

Contents

Installation

Manual mounting

Two options exist when manually mounting NTFS partitions. The traditional:

The mount type ntfs-3g does not need to be explicitly specified in Arch. The mount command by default will use /usr/bin/mount.ntfs which is symlinked to /usr/bin/ntfs-3g after the ntfs-3g package is installed.

The second option is to call ntfs-3g directly:

See ntfs-3g(8) for the available options.

Formatting

Configuring

Your NTFS partition(s) can be setup to mount automatically, or pre-configured to be able to mount in a certain way when you would like them to be mounted. This configuration can be done in the static filesystem configuration (fstab) or by the use of udev rules.

Default settings

Using the default settings will mount the NTFS partition(s) at boot. With this method, if the parent folder that it is mounted upon has the proper user or group permissions (e.g. /run/media/ /), then that user or group will be able to read and write on that partition(s).

Linux compatible permissions

Permissions on a Linux system are normally set to 755 for folders and 644 for files. It is recommended to keep these permissions in use for the NTFS partition as well if you use the partition on a regular basis. The following example assigns the above permissions to a normal user:

Alternatively, if the Windows permissions do matter to you, you can use the ntfsusermap(8) command to map Windows users to Linux ones. ntfs-3g will handle the translation of these permissions.

Allowing group/user

In /etc/fstab you can also specify other options like those who are allowed to access (read) the partition. For example, for you to allow people in the groupid group to have access:

By default, the above line will enable write support for root only. To enable user writing, you have to specify the user who should be granted write permissions. Use the uid parameter together with your user id to enable user writing:

If you are running on a single user machine, you may like to own the file system yourself and grant all possible permissions:

Basic NTFS-3G options

For most, the above settings should suffice. Here are a few other options that are general common options for various Linux filesystems. For a complete list, see ntfs-3g(8) § OPTIONS .

umask umask is a built-in shell command which automatically sets file permissions on newly created files. For Arch Linux, the default umask for root and user is 0022. With 0022 new folders have the directory permissions of 755 and new files have permissions of 644. You can read more about umask permissions here. fmask and dmask Like umask but defining file and directory respectively individually. noauto If noauto is set, NTFS entries in /etc/fstab do not get mounted automatically at boot. uid The user id. This allows a specific user to have full access to the partition. Your uid can be found with the id command.

The following option is specific to ntfs-3g only:

windows_names prevents files, directories and extended attributes to be created with a name not allowed by windows.

Allowing user to mount

By default, ntfs-3g requires root rights to mount the filesystem if it is a block device, even with the user option in /etc/fstab . See ntfs-3g-faq for details. The user option in the fstab is still required.

For non-blockfiles like normal images, ntfs-3g on the command-line should work out-of-the-box with normal user privileges as the underlying FUSE calls are redirected to the setuid-root fusermount when direct kernel interaction is unavailable.

Resizing NTFS partition

Most systems that are purchased already have Windows installed on it, and some people would prefer not wipe it off completely when doing an Arch Linux installation. For this reason, among others, it is useful to resize the existing Windows partition to make room for a Linux partition or two. This is often accomplished with a Live CD or bootable USB thumb drive.

For Live CDs the typical procedure is to download an ISO file, burn it to a CD, and then boot from it. InfraRecorder is a free (as in GPL3) CD/DVD burning application for Windows which fits the bill nicely. If you would rather use a bootable USB media instead, see USB flash installation media for methods to create bootable USB stick.

Читайте также:  Better joy mac os

There are a number of bootable CD/USB images avaliable. This list is not exhaustive, but is a good place to start:

  • GParted — Small bootable GNU/Linux distribution for x86 based computers. It enables you to use all the features of the latest versions of the GParted application. Does not include additional packages System Rescue CD may incorporate, and disk encryption schemes may not be supported.

http://gparted.sourceforge.net/ || gparted

  • Parted Magic — Very good complete hard disk management solution. With the Partition Editor you can re-size, copy, and move partitions. You can grow or shrink your C: drive. Create space for new operating systems. Attempt data rescue from lost partitions.

https://partedmagic.com/ ||

  • SystemRescueCD — Good tool to have, and works seamlessly in most cases. Once booted, run GParted and the rest should be fairly obvious.

https://www.sysresccd.org/ || systemrescuecdAUR

Note that the important programs for resizing NTFS partitions include ntfs-3g and a utility like (G)parted or fdisk, provided by the util-linux package. Unless you are an «advanced» user it is advisable to use a tool like GParted to perform any resize operations to minimize the chance of data loss due to user error.

If you already have Arch Linux installed on your system and simply want to resize an existing NTFS partition, you can use the parted and ntfs-3g packages to do it. Optionally, you can use the GParted GUI after installing the GParted package. At the core of the resizing is the ntfsresize(8) command.

Troubleshooting

Compressed files

When mounting an NTFS filesystem for Windows 10, and reading files or directories, you may

  1. see broken symbolic links to ‘unsupported reparse point’, or
  2. see the error message cannot access some_file: Input/output error (in this case you see Could not load plugin /usr/lib64/ntfs-3g/ntfs-plugin-80000017.so: Success in the journal).

The reason for this are NTFS reparse points, and that NTFS-3G does not support some types of reparse points by default. NTFS-3G plugins may be used to provide compatibility with a part of the features defined by the following reparse points

  • System compression
  • Deduplicated files
  • OneDrive files

See this page for further details.

System compression a.k.a. «Compact OS» compresses certain files. There are two possible workarounds for System compression.

You may install the NTFS-3G plugin ntfs-3g-system-compression AUR . Currently only reading is supported by this plugin, but not writing, i.e. creating or updating files is not supported.

Alternatively, disable the System compression feature in Windows 10

Damaged NTFS filesystems

If an NTFS filesystem has errors on it, NTFS-3G will mount it as read-only. To fix an NTFS filesystem, load Windows and run its disk checking program, chkdsk.

Note that ntfsfix can only repair some errors. If it fails, chkdsk will probably succeed.

To fix the NTFS file system, the device must already be unmounted. For example, to fix an NTFS partition residing in /dev/sda2 :

If all went well, the volume will now be writable.

Metadata kept in Windows cache, refused to mount

When dual booting with Windows 8 or 10, trying to mount a partition that is visible to Windows may yield the following error:

The problem is due to a feature introduced in Windows 8 called «fast startup». When fast startup is enabled, part of the metadata of all mounted partitions are restored to the state they were at the previous closing down. As a consequence, changes made on Linux may be lost. This can happen to any NTFS partition when selecting «Shut down» or «Hibernate» under Windows 8 or 10. Leaving Windows by selecting «Restart», however, is apparently safe.

To enable writing to the partitions on other operating systems, be sure fast startup is disabled. This can be achieved by issuing as an administrator the command:

You can check the current settings on Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do. The box Turn on fast startup should either be disabled or missing.

Deleting Windows hibernate metadata

As an alternative to above clean shutdown method, there is a way to completely destroy NTFS metadata that was saved after hibernating. This method is only feasible if you are not able or unwilling to boot into Windows and shut it down completely. This is by placing remove_hiberfile option when you are mounting your NTFS file system using ntfs-3g.

Mount failure

If you cannot mount your NTFS partition even when following this guide, try using the UUID instead of device name in /etc/fstab for all NTFS partitions. See fstab#File system UUIDs for an example.

Windows mount failure

Windows will not recognize a NTFS partition that does not have a corresponding partition type. A common pitfall when creating an NTFS partition to work with Windows is forgetting to set the partition type as NTFS. See fdisk or one of the partitioning tools.

Читайте также:  Png to webp windows

Beta features and releases

There is a web page on «advanced features», maintained by Jean-Pierre André, one of the NTFS-3G authors. It provides:

  • Documentation on handling of NTFS features in NTFS-3G, including:
    • Symlinks, junctions, and other reparse points
    • Extended attributes (xattrs) as an interface for ADS streams and special NTFS attributes
    • Security and permission, including POSIX mapping and ACL mapping
  • Plugins for parsing special reparse points.

Information provided in the documentation apply to the Tuxera version (2017.3.23) too. The system-compression and dedupe plugins work with the Tuxera version, but the onedrive plugin requires a tweak of the plugin-loading system only available in advanced releases.

Источник

  • ru
  • NTFS

NTFS (Windows NT FileSystem) — the latest in a long line of minor, proprietary, non-portable, file system formats promulgated by a commercial software vendor based in the Pacific North West, USA. Closed technology.

NTFS Drivers

Драйверы NTFS доступные в Debian:

ntfs

  • Linux kernel NTFS driver, поддерживает доступ только для чтения.
  • Available in mainline kernels.

ntfs-3g

    NTFS драйвер для FUSE, предоставляет доступы для чтения и записи.

Based on, and a major improvement to ntfsmount (see next item) and libntfs.

Available in the ntfs-3g package.

ntfsmount

    Userspace NTFS driver via FUSE, provides read and write access.

Available in the ntfsprogs package.

Obsolete

Requires Wine and the Microsoft Windows ntfs.sys driver.

No longer maintained and not recommended for use.

Usage Examples

mount

/etc/fstab

ntfs and ntfs-3g

The original tool used to mount ntfs partitions was /sbin/mount.ntfs. However, in Debian Squeeze this is symlink-ed to /sbin/mount.ntfs-3g, which is in turn symlink-ed to /usr/bin/ntfs-3g. So an entry in /etc/fstab that mounts an NTFS partition can specify either ntfs or ntfs-3g as its filesystem type, and both of these specifications will use the new NTFS filesystem driver ntfs-3g to mount the partition. ntfs-3g might be the preferred choice as it provides both read and write access to NTFS partitions.

Permissions for mounted partition(s)

For filesystem access by other users and groups on the system, refer to the mount(8) and fstab(5) man pages; note the umask, dmask, fmask, uid and gid options.

ntfsmount (man page, see also Debian bug 508982):

Источник

Как монтировать NTFS в Linux

Инструкция на примере Linux CentOS 7.

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

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

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

yum install epel-release

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

yum install ntfs-3g

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

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

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

mount -t ntfs /dev/sdb1 /mnt

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

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

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

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

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

/dev/sdb1 /mnt ntfs defaults 0 0

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

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

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

Источник

NTFS-3G (Русский)

NTFS-3G — свободная реализация файловой системы NTFS с поддержкой записи и чтения данных. Для упрощения разработки и обеспечения лучшей переносимости NTFS-3G использует драйвер файловой системы FUSE.

Contents

Установка

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

Вручную примонтировать раздел с NTFS можно двумя способами. Традиционный:

При этом тип файловой системы (в данном случае ntfs-3g ) явно сообщать необязательно. По умолчанию команда mount будет использовать программу /usr/bin/mount.ntfs , которая является символьной ссылкой на /usr/bin/ntfs-3g и появляется после установки пакета ntfs-3g.

Второй способ — напрямую вызвать ntfs-3g :

Настройка

Можно настроить автоматическое монтирование разделов NTFS, или заранее указать параметры монтирования и делать это вручную в удобное для вас время. Настройки задаются в файле fstab или с помощью правил udev.

Стандартные настройки

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

Добавьте эти строки в файл /etc/fstab :

Linux-совместимые права доступа

Как правило, права доступа в Linux устанавливаются как 755 для директорий и 644 для файлов. Если вы часто используете NTFS-раздел, рекомендуется использовать эти права доступа и на нём. Следующий пример показывает, как можно присвоить такие права разделу для работы с ним из-под непривилегированного пользователя:

Разрешение доступа пользователю/группе

Через файл /etc/fstab можно передать драйверу ntfs-3g и другие параметры монтирования, например разрешить доступ на чтение данных определённому пользователю или группе. Чтобы дать доступ к разделу пользователям, входящим в группу users , можно использовать следующие параметры:

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

Если у вас однопользовательская система, для большего удобства можно дать себе полный доступ к разделу:

Читайте также:  Mac os или deepin

Основные параметры NTFS-3G

В большей части случаев для работы должно хватить параметров, описанных выше. Далее описываются параметры, общие для многих файловых систем Linux. Полный список параметров конфигурации ntfs-3g можно посмотреть здесь [устаревшая ссылка 2021-05-17]

umask umask — команда командного интерпретатора, позволяющая автоматически присваивать нужные права доступа при создании новых файлов. Стандартные значения umask в Arch Linux для root и обычных пользователей — 0022. При этом новые директории получают права 755, а новые файлы — 644. Дополнительную информацию о umask можно найти здесь. noauto Если установлен параметр noauto , соответствующий раздел не будет монтироваться автоматически при загрузке системы. uid Идентификационный номер пользователя. Позволяет дать полный доступ к разделу определённому пользователю. Идентификатор пользователя можно определить с помощью команды id . fmask и dmask Похожи на umask , но задают права доступа к файлам и директориям отдельно.

Монтирование разделов от имени обычного пользователя

По умолчанию, ntfs-3g требует права суперпользователя для монтирования разделов, даже если добавить параметр «uid» в /etc/fstab (со причинами можно ознакомиться здесь). Чтобы иметь возможность монтировать раздел от имени обычного пользователя, выполните следующие шаги:

Если опция uid отсутствует в /etc/fstab, добавьте её:

Убедитесь, что пользователю разрешена работа с соответствующим устройством. Проще всего сделать это, добавив пользователя в группу disk с помощью следующей команды:

Далее, необходимо обеспечить пользователю доступ к директории, в которую монтируется раздел. Если вы собираетесь монтировать раздел от имени обычного пользователя, есть смысл поставить его владельцем точки монтирования:

Кроме того, необходимо использовать драйвер ntfs-3g со встроенной поддержкой FUSE. Пакет ntfs-3g из официальных репозиториев не имеет его поддержки, поэтому можно установить пакет ntfs-3g-fuse AUR из AUR.

При выполнении этих условий у вас должна появиться возможность монтировать разделы NTFS без прав суперпользователя.

Изменение размера раздела NTFS

Некоторые пользователи с установленной системой Windows хотели бы оставить её при установке Arch Linux. Часто для того, чтобы освободить место на диске под установку Arch Linux, возникает необходимость изменить размер системного раздела, на котором установлена Windows. Эту задачу можно выполнить одним из двух способов:

1) Воспользоваться встроенным в Windows средством управления разделами. Для его запуска нажмите Win+R, введите в появившееся окно diskmgmt.msc и нажмите Enter. Кликните по разделу, размер которого нужно уменьшить, правой кнопкой мыши, и выберите в меню пункт Сжать том. Укажите количество места, которое нужно освободить, и нажмите OK. После завершения операции за изменённым разделом появится свободное место, в котором можно будет создать необходимые разделы в процессе установки системы.

2) Воспользоваться сторонним LiveCD. Для этого скачайте ISO-образ любого диструбитива, в состав которого входят ntfs-3g и gparted (например, Ubuntu), либо образ специализированной системы для работы с разделами (например, GParted, Parted Magic или SystemRescueCD), и запишите его на компакт-диск или USB-накопитель с помощью программы UNetbootin или Rufus, после чего загрузитесь с подготовленного носителя. Дальнейшие инструкции можно получить в документации к используемому дистрибутиву.

Для изменения размера NTFS-раздела из существующей системы Arch Linux установите пакеты ntfs-3g и gparted и запустите программу gparted. Если в системе отсутствует графический пользовательский интерфейс, можно использовать программу parted, входящую в состав пакета parted .

Решение проблем

Повреждённая файловая система NTFS

Если в файловой системе NTFS есть ошибки, ntfs-3g смонтирует её в режиме «только чтение». Для штатного исправления файловой системы NTFS загрузите Windows и запустите chkdsk (chkdsk /F).

Для коррекции файловой системы NTFS без использования Windows установите пакет ntfs-3g , доступный в официальных репозиториях.

Для исправления файловой системы NTFS раздел должен быть отмонтирован. Пример ремонта NTFS-раздела /dev/sda2:

Если всё прошло без ошибок, раздел будет доступен для записи.

Metadata kept in Windows cache, refused to mount

Если вместе с Arch Linux на компьютере используется Windows 8, при монтировании системного раздела может возникнуть следующая ошибка:

Проблема вызвана новой функцией Windows 8 под названием «быстрый запуск». Когда эта функция включена, часть метаданных файловых систем всех используемых разделов при загрузке восстанавливается к тому состоянию, в котором они находились при завершении работы Windows. В результате изменения содержимого разделов, совершённые из Linux, могут быть утеряны. Это может произойти с любым разделом жёсткого диска, когда работа Windows завершается выбором пункта «Выключить» или «Гибернация». Однако, завершение работы Windows с помощью пункта «Перезагрузка» не должно вызывать таких проблем.

Чтобы получить возможность беспроблемно записывать данные на раздел из других операционных систем, убедитесь, что функция «быстрый запуск» отключена. Для этого загрузите Windows и выполните следующую команду в командной строке, запущенной от имени администратора:

Чтобы проверить текущее значение параметра, зайдите в Панель управления -> Оборудование и звук -> Электропитание -> Действия кнопок питания. Флажок Включить быстрый запуск должен быть снят либо отсутствовать.

Отказ в монтировании

Если, даже следуя этому руководству, вам не удаётся примонтировать раздел NTFS, попробуйте отредактировать файл /etc/fstab , указав UUID вместо имён устройств для всех разделов NTFS. С примером можно ознакомиться здесь.

Форматирование в NTFS

На современных устройствах большого объема такой способ может занять много времени. Для быстрого форматирования используйте команду:

Не учитывается umask при создании файлов

Если в /etc/fstab указана опция монтирования permissions , разделы NTFS-3G смогут имитировать работу с привычной системой прав доступа Linux. Однако, при создании файлов вплоть до версии 2014.2.15-1 не учитывается umask пользователя.

Как решение, используйте ABS для пересборки NTFS-3G без поддержки ACL ( —enable-posix-acls ):

Источник

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