- Error «parted: invalid token: 1» When Using Parted To Format A Partition?
- 3 Answers 3
- Steps:
- How To Create a Partition Using “parted” Command
- Creating a partition using parted
- 1. Select the hard disk to be partitioned
- 2. Set partition table type
- 3. Check free space and existing partitions
- 4. Creating Primary or Logical Partition in Selected Disk Using mkpart
- Remove a Partition Using rm Command
- Linux parted invalid token
- Ошибка «parted: invalid token: 1» При использовании Parted To Format Partition?
- Arch Linux
- #1 2013-05-26 22:22:47
- Trying to mark a grub GPT partition with parted give me error
- #2 2013-05-26 22:33:59
- Re: Trying to mark a grub GPT partition with parted give me error
- #3 2013-05-26 22:41:04
- Re: Trying to mark a grub GPT partition with parted give me error
Error «parted: invalid token: 1» When Using Parted To Format A Partition?
I’m trying to format an existing ext2 partition as ntfs (or any filesystem) using the mkfs command in Parted, but when I specify the partition to format I get:
«1» being the partition number I specified. I’m not sure what’s wrong. The goal here is to find the correct command. I’m not interested in work-arounds using a different program. I’m just doing this to learn the ins/outs of Parted. I’ve already read the manuals, and a ton of blog posts. The command I used was:
- Ubuntu 12.04 — Desktop X86-64
- Parted 2.3
- There is no valuable data on the machine. It’s just a vm running Ubuntu with 2 virtual hard drives attached. Sda: Ubuntu Sdb: The drive for testing Parted
3 Answers 3
The error message is because it is asking a yes/no question, and «1» is not yes or no. Don’t use parted’s mkfs command: it is incomplete ( doesn’t even support ntfs ), broken, and was removed from parted upstream several releases/years ago beacuse of this. Use mkntfs instead.
I don’t know about Parted, but try something like this in the shell:
Do not use /dev/sdXX . First find the partition. df -H lists currently mounted ones and their size. The partition should look something like /dev/sda1 or /dev/hda1 .
From the man page:
While the documentation in various sources states that «mkfs 1 fat32» is the correct command, and I’ve even found screenshots of people successfully using it, it doesn’t work in real life. However, as mentioned in my comments if you don’t specify the information ahead of time Parted will prompt you to input it later, and that will work. This of course means you cannot use the «mkfs» command in combination with the «-s» flag for automation purposes which sucks, but it gets the job done. Hopefully a better answer can be found. Note that NTFS is apparently not supported, which is why I’ve changed the examples to «fat32».
Steps:
Option 1:
In terminal type:
[«/dev/sdb» being the drive you want.]
In (Parted) terminal type:
When prompted to proceed choose «yes».
When prompted for partition enter number eg «1»
When prompted for filesystem enter choice eg «fat32»
Option 2:
In terminal type:
[«/dev/sdb» being the drive you want.]
When prompted to proceed choose «yes».
When prompted for partition enter number eg «1»
When prompted for filesystem enter choice eg «fat32»
Источник
How To Create a Partition Using “parted” Command
There are different options to create or manage partitions under Linux – Parted is one of them. This note describes its usage and the use case when creating a new partition table. Use parted interactively to enter commands one at a time. Include only the device as an argument to invoke interactive mode.
Creating a partition using parted
1. Select the hard disk to be partitioned
Select the disk on which the partition is being created, in the below example /dev/sdb is being partitioned. You can select the disk in below given two ways.
It is possible to execute “help” to see the various options provided in parted command
2. Set partition table type
The following example creates a new partition table by using the mklabel command. The disk label type must be one of the following: aix, amiga, bsd, dvh, gpt, mac, msdos, pc98, sun, or loop.
In the above output, it is possible to see that different LABEL-TYPEs are supported in parted. It is important to note that one will require to use msdos as LABEL-TYPE for generic Linux.
3. Check free space and existing partitions
To check free space and any existing partitions on the disk use the print sub-command. As you can see 21.5GB space is free on the disk and no partition is created yet on the disk.
4. Creating Primary or Logical Partition in Selected Disk Using mkpart
One can create either Primary or Logical partitions using mkpart command. Options can be primary and logical respectively. Example for both options are shown as below (we will create 2 partitions of 200MB each as primary and logical partition) :
a. Creating primary partition
b. Creating logical partition
Remove a Partition Using rm Command
One can also delete an existing partition using “rm” command, as shown in below example we have 2 partitions with number 1 and 2.
To delete partition 2:
Verify that you can see only the partition number 1 now.
Источник
Linux parted invalid token
Хотя help set (а также help set страница) просто дает вам некомментированный список флагов, он не говорит вам, какие флаги поддерживаются какой схемой разбиения.
Недопустимое сообщение токена, кажется, является тем, что вы получаете, когда флаг недоступен. Должно быть более удобное сообщение об ошибке.
В parted 3.2 для разделов GPT флаги swap , root , lba недоступны:
MSDOS поддерживает только эти флаги:
Итак, что случилось с флагом swap ?
Оказывается, это поддерживается DVH:
… а также разделы MAC:
Хорошая новость заключается в том, что Linux на самом деле не особо заботится о типах разделов. Таким образом, вы можете использовать любой раздел для подкачки, независимо от того, говорит ли таблица разделов.
Согласно приведенному выше коду, для метки раздела msdos нельзя установить hidden флаг, если раздел расширен. Это хороший способ проверить сообщение об ошибке, выдаваемое parted:
Итак, мы здесь. Неподдерживаемые флаги просто получают недопустимое сообщение с токеном, и это подразумевает, что вы ошиблись или что-то в этом роде, но вы не сделали ничего плохого, просто в некоторых случаях они не поддерживают эти флаги.
Раздел либо содержит файловую систему, в данном случае ext4 , либо содержит пространство подкачки и не имеет файловой системы. Поэтому нет смысла добавлять флаг swap в раздел файловой системы.
Если вы хотите создать файл подкачки в файловой системе позже, нет необходимости добавлять флаг в раздел. Вы просто создаете файл и используете его для обмена.
Источник
Ошибка «parted: invalid token: 1» При использовании Parted To Format Partition?
Снимок экрана: http://imgur.com/DQnhwG2
Я пытаюсь отформатировать существующий раздел ext2 как ntfs (или любую файловую систему), используя команду mkfs в Parted, но когда я определяю раздел в формате, я получаю:
«1» – это номер раздела, который я указал. Я не уверен, что случилось. Цель здесь – найти правильную команду. Меня не интересует работа с другой программой. Я просто делаю это, чтобы узнать, что такое Parted. Я уже читал руководства и тонну сообщений в блогах. Команда, которую я использовал, была:
- Ubuntu 12.04 – Рабочий стол X86-64
- Размещено 2.3
- На машине нет ценных данных. Это всего лишь vm, работающий с Ubuntu с приложением 2 виртуальных жестких дисков. Sda: Ubuntu Sdb: диск для тестирования Parted
Сообщение об ошибке связано с тем, что оно задает вопрос «да / нет», а «1» – «да» или «нет». Не используйте команду partk’s mkfs: она неполна (даже не поддерживает ntfs), сломана, и была удалена из разложенного вверх по потоку нескольких выпусков / лет назад. mkntfs этого используйте mkntfs .
Я не знаю о Parted, но попробуйте что-то подобное в оболочке:
Не используйте /dev/sdXX . Сначала найдите раздел. df -H перечисляет в настоящее время установленные и их размер. Раздел должен выглядеть примерно как /dev/sda1 или /dev/hda1 .
На странице руководства:
Хотя в документации в разных источниках указано, что «mkfs 1 fat32» является правильной командой, и я даже нашел скриншоты людей, успешно использующих ее, она не работает в реальной жизни. Однако, как упоминалось в моих комментариях, если вы не укажете информацию раньше времени, Parted предложит вам ввести ее позже, и это будет работать. Это, конечно же, означает, что вы не можете использовать команду «mkfs» в сочетании с флагом «-s» для целей автоматизации, которая отстой, но она выполняет свою работу. Надеюсь, лучший ответ можно найти. Обратите внимание, что NTFS, по-видимому, не поддерживается, поэтому я изменил примеры на «fat32».
Опция 1:
В терминальном типе:
[«/ dev / sdb» – диск, который вы хотите.]
В терминале (Parted):
Когда будет предложено продолжить, выберите «Да».
При запросе раздела введите номер, например «1»,
Когда будет предложено ввести файловую систему, например, «fat32»,
Вариант 2:
В терминальном типе:
[«/ dev / sdb» – диск, который вы хотите.]
Когда будет предложено продолжить, выберите «Да».
При запросе раздела введите номер, например «1»,
Когда будет предложено ввести файловую систему, например, «fat32»,
Источник
Arch Linux
You are not logged in.
#1 2013-05-26 22:22:47
Trying to mark a grub GPT partition with parted give me error
i try to mark mygrub partition to boot my system and when i reach the line in grub archwiki
parted /dev/disk set X bios_grub on
Parted: Invalid token: bios_grub
Last edited by Ferdinand866 (2013-05-27 22:43:35)
I have a hamradio license and know over Sail Boats too. My natural languaje is spanish.
#2 2013-05-26 22:33:59
Re: Trying to mark a grub GPT partition with parted give me error
Have you already made the parition? I know next to nothing about using parted, I am a gptfdisk user myself (gdisk), but I do know that if that is the exact command you used, you are not actually specifying anything with /dev/disk. There is a /dev/disk directory, but it leads to a bunch of symlinks for various alternative names for /dev/sda, /dev/sdb, etc. I think what it is asking for is to actually specify the partition where the small grub partition is located. So if you put it at the beginning of the first disk it would be /dev/sda1.
Alternatively, you could just use gdisk. I think gdisk is much much more user friendly, and has a much saner approach to partition type codes. Use the interactive functionality with «gdisk /dev/sda» (assuming you want to modify sda), then enter a «?» to get a list of available options. I think it is a «t» that allows you to change the partition’s type code. Select the partition you want to modify, and then change the code to ef02.
#3 2013-05-26 22:41:04
Re: Trying to mark a grub GPT partition with parted give me error
> you are not actually specifying anything with /dev/disk
yeah and sry .The command /dev/sdx represents /dev/sdc for example the disk i have to change where resides the grub especial boot partition and was created too.
X is the number of that partition , but the error is related to a token in part and the help on the command part give me that token valid as root,etc ,etc ,etc ,etc ,grub_bios, etc, etc.
Ok ty ,i try to make whit that another friendly partitioner. Last time i try fdisk but dont have the option EF02 only have the EF option in types .
Last edited by Ferdinand866 (2013-05-26 22:45:30)
I have a hamradio license and know over Sail Boats too. My natural languaje is spanish.
Источник