Mkfs ntfs команда не найдена
On several machines that I've upgraded from Natty to Oneiric, I get an error every boot (one for every NTFS partition):
Following the suggestion in this answer, I ran fsck from the manual recovery shell. I got this output:
I can't find fsck.ntfs, and command-not-found doesn't help either. How can I make this error go away?
By the way, I've tried booting into Windows (XP) several times, thinking that Windows would repair the filesystems. But apparently Windows thinks the filesysystems are just fine. And it's odd that all NTFS filesystems are affected.
Also, I can work around this problem by dropping to a recovery shell and issuing mount -a , but for my coworkers' sakes I need unattended boot.
I can't find fsck.ntfs I think you should go with ntfsck or ntfsfix for ntfs partitions, AFAIK fsck is mainly used for ext partition.
parted
parted doesn't need an argument (it tries to "guess"), but you should always specify the disk. Given the choice, parted is the program you should prefer. It has the following commands:
The commands can be contracted to a unique prefix (e.g., h is short for help ).
I'm going to use a temporary file ( /tmp/part ) I created to show you the commands, so the sizes will be somewhat small. You should replace that with the device you need ( /dev/sda , for example).
First, if your disk doesn't have a partition table, we must create one:
or mklabel msdos , if you want the old-school 4-primary-partition thing (called MBR or MSDOS partition table). Then we make, say, an ext4 partition starting starting at 3GB (i.e., leaving the initial 3G free) and of size 2GB (i.e., ending at 5GB). parted expects locations in MB for mkpartfs , but we can specify the suffix:
And another, now an NTFS partition of 1GB:
Note how it uses SI prefixes, whereas GParted steadfastly uses binary prefixes (while dropping the silly i ). I'll label the partitions:
While parted can create partitions of filesystem ntfs just fine, it can't format an existing partition (!) to NTFS:
Indeed, parted will tell you that you should use it for manipulating partitions, not filesystems, which brings me to:
mkfs , like fsck , is essentially a frontend to various filesystem-specific commands. On my system for example, mkfs.bfs , mkfs.cramfs , mkfs.ext2 , mkfs.ext3 , mkfs.ext4 , mkfs.ext4dev , mkfs.fat , mkfs.minix , mkfs.msdos , mkfs.ntfs , mkfs.vfat are available.
Now, unfortunately, while parted operates just fine on a file, like the one I used above, mkfs can't go hunting for partitions in such files. In fact, it expects block devices, so if I'm going to use a new file /tmp/file for mkfs , I have to force it do so. You'll use the block device corresponding to the partition you want to format, such as /dev/sda2 . The general syntax for mkfs is:
As you can see, the -t flag lets us pass filesystem-specific flags. For example, NTFS flags:
So let's make an NTFS partition, with quick formatting ( -Q ), forcing it to operate on a non-block-device file ( -F ), and setting a label ( -L "hello world" ).
Clearly it didn't enjoy working on a file. :) Don't worry, it should automatically detect most values when working on an actual disk. Even this "file" works fine as a filesystem:
(See the weird permissions?)
2 Answers 2
There are a few options available:
-
. (the CLI brother of GParted).
- The various mkfs programs, if you already have partitions and wish to format.
fdisk and parted are interactive, and have help commands, so you can always look for help within the program. Both are also scriptable. The mkfs commands are not interactive.
Note on parted usage:
The syntax of the parted program is:
When you run parted without a command, like:
You'll be presented a simple shell, where you can run the above commands. However, these commands can also be run directly using the parted program. So these three are equivalent:
Note also that, when creating partitions with parted , a useful indicator of end of partitions is -1s (this is "1" between the hyphen and the "s"). This is useful if you want your partition to span from a specified start to the rest of the disk. To be more specific, running
will create a partition of /dev/sda that starts at 3G and ends at the last sector of the /dev/sda disk (i.e. it spans from 3G to the whole remainder of the disk). Note that the -- is necessary, for 1s not to be interpreted as an invalid option.
На kubuntu перешел недавно. Раньше пользовался другими дистрибутивами. Не в этом вопрос.
Потребовалось отформатировать флешку в ntfs. С недоумением обнаружил, что не могу сделать этого на своем недобуке, на который поставил kubuntu-13.04.
Это баг, фича или моя криворукость?
Гость - 21 Май, 2013 - 16:22
mkntfs
DarkneSS - 21 Май, 2013 - 16:23
partitionmanager-kde, gparted или ещё сотня программ, которые можно найти в поиске. Первый должен быть предустановлен.
NikolayTrB - 21 Май, 2013 - 16:26
Просто partitionmanager, без -kde
Artemy - 21 Май, 2013 - 16:48
partitionmanager не может создать ntfs. В информации о поддерживаемых файловых системах на создании раздела ntfs стоит жирный крест.
DarkneSS - 21 Май, 2013 - 16:54
Ээ. ntfsprogs не стоит?
Artemy - 21 Май, 2013 - 17:03
Конечно стоит. "Багу" нашел и описал ниже.
Schaman - 21 Май, 2013 - 21:07
Вот не надо. скрин в студию чтоб видели все.
Artemy - 22 Май, 2013 - 10:01
Хоть причину я уже ликвидировал, но для тебя, камрад, восстановлю свою начальную ситуацию. Очевидно же, что сделать откат, скриншот и вновь вернуть работоспособность утилиты мне проще и быстрее, чем тебе дочитать ветку до конца.
Artemy - 21 Май, 2013 - 16:59
Нашел причину. В /sbin стоит ссылка с mkfs.ntfs на /usr/sbin/mkntfs. Вероятно это промежуточный глюк к переводу /sbin в /usr/sbin.
После исправления ссылки на реальный /sbin/mkntfs заработало и привычное mkfs.ntfs и помянутый выше partitionmanager/
Но разделы доступные только для чтения. Какие параметры выставить для монтирования с возможностью записи?
- Вопрос задан 04 дек. 2021
- 294 просмотра
Простой 9 комментариев
а вручную пробовали ? может какие-то ошибки пишет
mount -t ntfs3 --uuid 96E654E1E654C363 /mnt/data
да и гляньте присутствует ли в ядре
zgrep CONFIG_NTFS3_FS /proc/config.gz
nihi1ist,
попробуйте тогда так:
grep CONFIG_NTFS3_FS /boot/config-`uname -r`
так что там с ручным монтированием ?
nihi1ist, ошибок не выдало ?
для примера возьмём диск /dev/sda, создадим на нём раздел и отформатируем в ntfs
создадим таблицу разделов(ТР) gpt, осторожно, старая ТР будет удалена, и создадим 1 раздел на весь диск:
смотрим что всё получилось:
форматируем в ntfs
либо в винда либо в линукс, в linux утилита mkfs.ntfs ставится вместе с ntfs-3g, ну или другим пакетом в зависимости от дистрибутива, сами paragon чей новый драйвер теперь в ядре 5.15 сказали что позже предоставят свою утилиту fsck и mkfs для ntfs
$ mkfs.ntfs /dev/sda1
шаги выше можно пропустить если уже есть готовый раздел с ntfs
далее создадим папку для монтирования и примонтируем раздел, можно по uuid или как обычно подставив имя раздела(/dev/sda1):
убедимся что всё примонтировалось нормально, а также смотрим опции которые система выдала по умолчанию:
9 Answers 9
fsck.ntfs is usually only a link to ntfsfix which is an utility from the package ntfsprogs that is already available with a standard installation of Ubuntu.
You can make a simbolic link between fsck.ntfs and ntfsfix to solve this permanently:
Keep in mind that this utility came from a reverse engineering process and are not the best option to manage your filesystem, the NTFS filesystem does not belong to the GNU/linux world.
Thanks. I set up the symlinks (which should have been made already) and the problem is solved. The only question that remains is: Why was the symlink missing in the first place? fsck apparently runs on boot. Therefore, it is a bug if it tries to check a filesystem that it can't handle. The partition was--and has been--perfectly fine. Apparently this was just a routine check that was failing.
It is funny I trust a community reversed engineered tool a lot more than the official Microsoft tool which destroyed my perfectly working NTFS partitions before :)
You can count more on Linux-based tools to recover your Windows installation and data than the Windows-based tools. Also I experienced that Linux lets you do things such as putting question marks in your filenames; this is officially permitted by NTFS standards but here's the joke: the Windows driver doesn't support it! I would like to point at dedicated "Linux-based Rescue / Repair Live-CDs" (or USB) such as SystemRescueCD.
I think it could be noted for some people that ntfsfix gets installed into /bin/ instead of /usr/bin . So
If you have already created the symlink from /usr/bin/
And then create the symlinks again.
upvoted because a) downvoter left no comment explaining downvote, which would be courteous at least, and b) just had to 'locate ntfsfix' to find mine at /bin/ntfsfix, so it seems relevant at least.
If you have an NTFS partition automatically mounted at startup, the only reason could be you have manually or through some tool added it to /etc/fstab (not taking into account WUBI).
If the system tries to check the partition at startup it means that in the corresponding line in /etc/fstab there is a sixth field and its value is 1 or 2 .
ntfsfix is not linked by default to fsck.ntfs , and it only provides limited check capabilities, as explained in the man page:
ntfsfix is a utility that fixes some common NTFS problems. ntfsfix is NOT a Linux version of chkdsk. It only repairs some fundamental NTFS inconsistencies, resets the NTFS journal file and schedules an NTFS consistency check for the first boot into Windows.
The common solution is not to create the symlink, but to remove or set to 0 the sixth field in /etc/fstab .
Такие дела. Как же неудобно в этих ваших блобо дистрах без юзов. Вот как мне угадать что ему надо установить?
Ну что за убунтодети пошли.
sudo ln -sf /sbin/mkntfs /sbin/mkfs.ntfs
Очередное местное решение? Блин, ну нафига предлагать это?
Программа 'mkfs.ntfs' на данный момент не установлена. Вы можете установить её, выполнив: apt-get install ntfs-3g
mkntfs is part of the ntfs-3g package
Затем сделать sudo ln -sf /sbin/mkntfs /sbin/mkfs.ntfs
Ненавижу хомячков, которые считают себя специалистами :)
Ненавижу хомячков, которые считают себя специалистами
Я должен угадывать как у вас там называется команда вызывающая то что мне нужно?
Вы можете установить её, выполнив: apt-get install ntfs-3g
Гугл в зубы, там дураков пока ещё терпят :)
Это каким мозгом надо обладать чтоб симлинкать друг с другом различные утитлиты?
sh4r4t4n ★ ( 10.08.13 19:45:05 )
Последнее исправление: sh4r4t4n 10.08.13 19:45:20 (всего исправлений: 1)
А что /sbin не в $PATH?
Признаёшь что твой пакетный менеджер неинформативное говно?
mkntfs там же но работает.
Признаёшь что твой пакетный менеджер неинформативное говно?
Я сейчас пока ещё в венде, тут вообще пакетного менеджера нет, а вот кое-кто совсем дурак и даже не знает, чем пользуется. В следующий раз сразу вбивай команду sdelat_mne_zaebis, чо
Один не знает, как создать файловую систему, другой не знает, что ntfs-3g и ntfsprogs объедились. Что вы вообще тут делаете с линуксом?
sh4r4t4n ★ ( 10.08.13 20:02:40 )
Последнее исправление: sh4r4t4n 10.08.13 20:06:20 (всего исправлений: 2)
Один не знает, как создать файловую систему
mkfs.ntfs /dev/sdb1 Cluster size has been automatically set to 4096 bytes. Initializing device with zeroes: 4%
Прикинь, работает! Вот только пришлось загружать другую машину.
другой не знает, что ntfs-3g и ntfsprogs объедились
Без этого знания никто не имеет права пользоваться линуксом? Мне заняться больше нечем как следить за форками, объединениями и смертями проектов. Мне надо чтоб работало.
Что вы вообще тут делаете с линуксом?
Пользуемся. Может мы его позорим?
Вот только пришлось загружать другую машину.
Дай угадаю. Там другая версия ntfs-3g? :)
Без этого знания никто не имеет права пользоваться линуксом?
А с каких пор домохозяйкам нельзя пользоваться линуксом?
У меня работает. У тебя - нет. Вывод сам додумай.
Ради вас бубунту придумывали. Тут только себя опозорить получилось. Ах да, mkntfs это слишком сложно, для домохозяек в бубунте есть gnome-disks :)
Дай угадаю. Там другая версия ntfs-3g
там просто mkfs.ntfs работает.
У меня работает. У тебя - нет. Вывод сам додумай.
Идиот? У меня был вопрос о «дружелюбности» и апт ей не отличился.
Чтоб на них не работать?
Покажи в каком ещё дистрибутиве есть этот сурогат.
Покажи в каком ещё дистрибутиве есть этот сурогат.
I want to know how to format a storage drive from the terminal. Helpful things to provide in the answer would be often used options for commands and base knowledge that one can use to extrapolate future uses. Specifically I would like to know how to format in the different file systems such as NTFS, FAT32, EXT4, etc. Information on how to partition the drive via terminal is also wanted.
I am trying to format a high capacity external hard drive (EHDD) into NTFS - from the terminal.
I know I can use gparted for this as well as other GUI programs, but I still want to now how to do it from the terminal.
To whoever will anser: make sure to explain the option -m on reserved space - it's relevant, because it's couterintuitive.
fdisk
fdisk expects a device (such as /dev/sda ) as an argument. It has the following commands:
I don't use fdisk that much. I'll just focus on:
Notes:
- I haven't used sudo anywhere in this answer yet. Since I was operating on files, and files owned by me, I didn't need sudo . parted will warn you about this. For block devices, which are usually always owned by root , you will need sudo (or you'll have to use a root shell via sudo -i or sudo su - ).
- parted is a GNU program, and like many GNU programs, has extensive documentation in the info format. Install parted-doc ( sudo apt-get install parted-doc ) and then run info parted . You can also checkout the online user's manual.
- GParted is able to format a partition to NTFS as it calls the appropriate mkfs program directly ( mkntfs , in this case - mkfs.ntfs is just a link to mkntfs ). It also sets a number of parameters. In fact, for most operations, you can examine the details of the GParted messages to see which commands were run.
- I won't go into the merits of GPT vs MBR/MSDOS partition tables, but GPT is likely to be found on new devices with UEFI, especially if you got Windows 8 on them. The state of partitioning tools? discusses what tools are available if you're facing GPT.
- LVM, ZFS and btrfs are a whole another game. They all have their accompanying tools, and you should use them instead of parted or fdisk (except perhaps for an initial step of creating partitions for their use).
Читайте также: