How do I create a swap partition using parted? The 2019 Stack Overflow Developer Survey Results Are InFile system is not clean (The partition is misaligned by 1024 bytes)Partition deallocatedswapon: /dev/sdb1: swapon failed: Invalid argumentSplitting one partition into threeI want to increase the size of my boot partition (Ubuntu 14.04 version)Changing disk space allocationRecovering a partition with no valid superblocks8TB Hard Disk mount failedEFI partition not found installing in Legacy mode, UEFI error installing in UEFIWhy does fdisk and parted not show same partition table on a fresh bootable usb image

Geography at the pixel level

How to deal with fear of taking dependencies

How to make payment on the internet without leaving a money trail?

Why is the maximum length of openwrt’s root password 8 characters?

How long do I have to send payment?

Why do UK politicians seemingly ignore opinion polls on Brexit?

Is "plugging out" electronic devices an American expression?

How can I create a character who can assume the widest possible range of creature sizes?

What is a mixture ratio of propellant?

Is there a name of the flying bionic bird?

If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned?

Falsification in Math vs Science

Manuscript was "unsubmitted" because the manuscript was deposited in Arxiv Preprints

Where to refill my bottle in India?

Does it makes sense to buy a new cycle to learn riding?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

What does "rabbited" mean/imply in this sentence?

Carnot-Caratheodory metric

Why can Shazam do this?

Can I write a for loop that iterates over both collections and arrays?

What tool would a Roman-age civilization have to grind silver and other metals into dust?

Spanish for "widget"

What is the best strategy for white in this position?

Is it possible for the two major parties in the UK to form a coalition with each other instead of a much smaller party?



How do I create a swap partition using parted?



The 2019 Stack Overflow Developer Survey Results Are InFile system is not clean (The partition is misaligned by 1024 bytes)Partition deallocatedswapon: /dev/sdb1: swapon failed: Invalid argumentSplitting one partition into threeI want to increase the size of my boot partition (Ubuntu 14.04 version)Changing disk space allocationRecovering a partition with no valid superblocks8TB Hard Disk mount failedEFI partition not found installing in Legacy mode, UEFI error installing in UEFIWhy does fdisk and parted not show same partition table on a fresh bootable usb image



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















How do I create a swap partition using command line gparted? (parted)



I've managed to create a partition but I can't seem to set the partition to Linux swap / Solaris.
I've tried



mkpart extended linux-swap -512MB -1s
// -> Error: Invalid number.
&

mkpart extended linux-swap(v1) -512MB -1s
// -> Error: Invalid number.
&

mkpart
type: extended
Start: -512MB
End: -1s
// this works, but I can't set the FS-TYPE


// help page



(parted) help mkpart 
mkpart PART-TYPE [FS-TYPE] START END make a partition

PART-TYPE is one of: primary, logical, extended
FS-TYPE is one of: zfs, btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp, linux-swap(v1), linux-swap(v0), ntfs,
reiserfs, freebsd-ufs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs, amufs5, amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5,
affs4, affs3, affs2, affs1, affs0, linux-swap, linux-swap(new), linux-swap(old)
START and END are disk locations, such as 4GB or 10%. Negative values count from the end of the disk. For example, -1s specifies exactly the
last sector.

'mkpart' makes a partition without creating a new file system on the partition. FS-TYPE may be specified to set an appropriate partition ID.









share|improve this question
















bumped to the homepage by Community 5 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1





    Create a partition without a filesystem and run mkswap is the simplest way.

    – muru
    Oct 19 '17 at 16:06

















0















How do I create a swap partition using command line gparted? (parted)



I've managed to create a partition but I can't seem to set the partition to Linux swap / Solaris.
I've tried



mkpart extended linux-swap -512MB -1s
// -> Error: Invalid number.
&

mkpart extended linux-swap(v1) -512MB -1s
// -> Error: Invalid number.
&

mkpart
type: extended
Start: -512MB
End: -1s
// this works, but I can't set the FS-TYPE


// help page



(parted) help mkpart 
mkpart PART-TYPE [FS-TYPE] START END make a partition

PART-TYPE is one of: primary, logical, extended
FS-TYPE is one of: zfs, btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp, linux-swap(v1), linux-swap(v0), ntfs,
reiserfs, freebsd-ufs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs, amufs5, amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5,
affs4, affs3, affs2, affs1, affs0, linux-swap, linux-swap(new), linux-swap(old)
START and END are disk locations, such as 4GB or 10%. Negative values count from the end of the disk. For example, -1s specifies exactly the
last sector.

'mkpart' makes a partition without creating a new file system on the partition. FS-TYPE may be specified to set an appropriate partition ID.









share|improve this question
















bumped to the homepage by Community 5 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1





    Create a partition without a filesystem and run mkswap is the simplest way.

    – muru
    Oct 19 '17 at 16:06













0












0








0








How do I create a swap partition using command line gparted? (parted)



I've managed to create a partition but I can't seem to set the partition to Linux swap / Solaris.
I've tried



mkpart extended linux-swap -512MB -1s
// -> Error: Invalid number.
&

mkpart extended linux-swap(v1) -512MB -1s
// -> Error: Invalid number.
&

mkpart
type: extended
Start: -512MB
End: -1s
// this works, but I can't set the FS-TYPE


// help page



(parted) help mkpart 
mkpart PART-TYPE [FS-TYPE] START END make a partition

PART-TYPE is one of: primary, logical, extended
FS-TYPE is one of: zfs, btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp, linux-swap(v1), linux-swap(v0), ntfs,
reiserfs, freebsd-ufs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs, amufs5, amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5,
affs4, affs3, affs2, affs1, affs0, linux-swap, linux-swap(new), linux-swap(old)
START and END are disk locations, such as 4GB or 10%. Negative values count from the end of the disk. For example, -1s specifies exactly the
last sector.

'mkpart' makes a partition without creating a new file system on the partition. FS-TYPE may be specified to set an appropriate partition ID.









share|improve this question
















How do I create a swap partition using command line gparted? (parted)



I've managed to create a partition but I can't seem to set the partition to Linux swap / Solaris.
I've tried



mkpart extended linux-swap -512MB -1s
// -> Error: Invalid number.
&

mkpart extended linux-swap(v1) -512MB -1s
// -> Error: Invalid number.
&

mkpart
type: extended
Start: -512MB
End: -1s
// this works, but I can't set the FS-TYPE


// help page



(parted) help mkpart 
mkpart PART-TYPE [FS-TYPE] START END make a partition

PART-TYPE is one of: primary, logical, extended
FS-TYPE is one of: zfs, btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp, linux-swap(v1), linux-swap(v0), ntfs,
reiserfs, freebsd-ufs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs, amufs5, amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5,
affs4, affs3, affs2, affs1, affs0, linux-swap, linux-swap(new), linux-swap(old)
START and END are disk locations, such as 4GB or 10%. Negative values count from the end of the disk. For example, -1s specifies exactly the
last sector.

'mkpart' makes a partition without creating a new file system on the partition. FS-TYPE may be specified to set an appropriate partition ID.






command-line partitioning swap parted






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 19 '17 at 16:05









muru

1




1










asked Oct 19 '17 at 15:55









dendendenden

11614




11614





bumped to the homepage by Community 5 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 5 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









  • 1





    Create a partition without a filesystem and run mkswap is the simplest way.

    – muru
    Oct 19 '17 at 16:06












  • 1





    Create a partition without a filesystem and run mkswap is the simplest way.

    – muru
    Oct 19 '17 at 16:06







1




1





Create a partition without a filesystem and run mkswap is the simplest way.

– muru
Oct 19 '17 at 16:06





Create a partition without a filesystem and run mkswap is the simplest way.

– muru
Oct 19 '17 at 16:06










1 Answer
1






active

oldest

votes


















0














If you already have the partition created, I think you can use "mkswap" instead of "mkpart".






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f966394%2fhow-do-i-create-a-swap-partition-using-parted%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If you already have the partition created, I think you can use "mkswap" instead of "mkpart".






    share|improve this answer



























      0














      If you already have the partition created, I think you can use "mkswap" instead of "mkpart".






      share|improve this answer

























        0












        0








        0







        If you already have the partition created, I think you can use "mkswap" instead of "mkpart".






        share|improve this answer













        If you already have the partition created, I think you can use "mkswap" instead of "mkpart".







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 19 '17 at 16:03









        John AndersonJohn Anderson

        245129




        245129



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f966394%2fhow-do-i-create-a-swap-partition-using-parted%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

            Where else does the Shulchan Aruch quote an authority by name?Parashat Metzora+HagadolPesach/PassoverShulchan Aruch UTF-8Anonymous glosses in the Shulchan AruchWhy is the Shulchan Aruch definitive?Siman 32, Kitzur Shulchan Aruch: UntranslatedLitvaks/Yeshivish and Shulchan AruchBuying a Shulchan AruchEnglish version of SHULCHAN ARUCHIs there any place where Shulchan Aruch rules with the Rosh against the Rif and Rambam?Are there practices where Sepharadim do not hold by Shulchan Aruch?5th part of the shulchan aruch

            fallocate: fallocate failed: Text file busy in Ubuntu 17.04? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)defragmenting and increasing performance of old lubuntu system with swap partitionIssue with increasing the root partition from the swapthis /usr/bin/dpkg returned error || ubuntu-16.04, 64bitDefault 17.04 swap file locationHow to Resize Ubuntu 17.04 Zesty Swap file size?Ubuntu freezes from online formsMy Laptop is not starting after upgrade ubuntu 16.04 (Kernel 4.8.0-38 to 04.10.0-36)hcp: ERROR: FALLOCATE FAILED!Not sure my swap is being usedWine 3.0 asking for more virtual free swap