[Parted-maintainers] Bug#1021403: [parted] /usr/sbin/parted: invalid token: swap

Jean-Marc LACROIX jeanmarc.lacroix at free.fr
Fri Oct 7 16:29:14 BST 2022


Package: parted
Version: 3.4-1
Severity: critical

Dear maintainers,

According documentation available in man it seems possible to create one 
partition of type "swap" by using "set" option on command line.

After many tests done with Linux "parted" command and Ansible module 
"parted", it seems that it is not possible to set one logical partition 
as a swap partition with the flag option available into parted tool.

My disk uses for test has following partitions...

ansible at thinkpad-410:~$ sudo fdisk -l /dev/sda
Disque /dev/sda : 931,51 GiB, 1000204886016 octets, 1953525168 secteurs
Modèle de disque : HGST HTS721010A9
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 4096 octets
taille d'E/S (minimale / optimale) : 4096 octets / 4096 octets
Type d'étiquette de disque : dos
Identifiant de disque : 0x483880d2

Périphérique Amorçage    Début        Fin   Secteurs Taille Id Type
/dev/sda1    *            2048   48828415   48826368  23,3G 83 Linux
/dev/sda2             48830462 1953523711 1904693250 908,2G  5 Étendue
/dev/sda5             48830464   68360191   19529728   9,3G 8e LVM Linux
/dev/sda6             68362240   70361087    1998848   976M 82 partition 
d'échange Linux / Solaris
/dev/sda7             70363136   74266623    3903488   1,9G 8e LVM Linux
/dev/sda8             74268672  279068671  204800000  97,7G 8e LVM Linux

and when i try to set one partition with swap, then ...

ansible at thinkpad-410:~$ sudo  /usr/sbin/parted -s -m -a optimal /dev/sda 
-- unit KiB set 6 swap on
/usr/sbin/parted: invalid token: swap

I have also tried, but without success...

ansible at thinkpad-410:~$ sudo  /usr/sbin/parted -s -m -a optimal /dev/sda 
-- unit KiB set 6 swap on set 6 lvm off
/usr/sbin/parted: invalid token: swap


Of course, it is possible to use fdisk , but my challenge is to use only 
some Ansible modules (if possible !)

Thanks in advance for your help

-- 
     -- mailto : jeanmarc.lacroix at free.fr   --



More information about the Parted-maintainers mailing list