Talk:Parted

From ArchWiki

Resizepart command when resizing

I noticed there's a difference between the "Growing partitions" and "Shrinking partitions" sections. The latter ends with the following command, while the former doesn't:

 # resizepart device number size

So it seems one should notify the kernel about the new size of the partition only when shrinking it. But why one doesn't need it when growing a partition? It would be nice if someone could add an explaination (which I unfortunately don't know). Thanks.

Fturco (talk) 16:15, 28 August 2015 (UTC)Reply


Resizepart command was removed in version 3.0

BStrauss3 (talk) 12:47, 4 July 2020 (UTC)Reply

Auto alignment with using 0%.

https://wiki.archlinux.org/index.php?title=GNU_Parted&type=revision&diff=424616&oldid=412084 Auto alignment work if using 'mkpart primary ext4 0% 100%' but didnt with something like '(parted) mkpart primary ext4 0% 513mib'.

—This unsigned comment is by Althathwe (talk) 10:59, 23 May 2016‎. Please sign your posts with ~~~~!

Linked to 'parted' Manual doesn't list ext3 or ext4 for fs-type

Moved from Talk:Beginners' guide -- Alad (talk) 14:27, 5 July 2016 (UTC)Reply

Hi guys. Recent Arch convert here. Loving it. No bloat! Noticed this during Beginners Guid install though:

In the section on using parted ( Beginners'_guide#Partition_schemes ), it links to the Gnu parted manual at http://www.gnu.org/software/parted/manual/parted.html#mkpart for fs-types, but the (rather dated?) manual doesn't list ext3 or ext4. At this point I 'guessed' ext2 was the right choice... Only to find that LATER in the 'Beginners Guide' page it recommended ext4. Damn! Wasn't sure if I had to go back and re-do. Seemed not. But anyway, confusing for 'Beginners'. Anyway, dare not edit the wiki being an Arch noob at this point. Keep up the good work! Cheers. -- Peterg4000 (talk) 00:53, 7 April 2015 (UTC)Reply

Yes, this is a rather confusing concept: the file system type associated to a partition is a different thing from the file system that you later use to format that partition... It's explained in a bit clearer way in Wikipedia:Disk_partitioning#PC_partition_types, but we should probably explain it better here too.
In theory, using "ext2", "ext3" or "ext4" when you use (parted) mkpart shouldn't make any difference at all, as they all set the same partition type code. What does make a difference is the file system you choose when you actually format the partition in Beginners'_guide#Create_filesystems.
Of course it's wise to make sure the fs-type corresponds to the file system that is going to be used, but even though I've never tested it, I guess you could use e.g. "NTFS" for fs-type and still be able to format the partition with ext4 or whatever file system you want.
Kynikos (talk) 13:49, 7 April 2015 (UTC)Reply
Oh, so for ext3/4 one should just set fs-type to ext2 in parted (etc). Lesson learnt. A one liner would be good saying something like "If you don't know any better, set fs-type to ext2 (Which is the correct option for ext2/3/4), and then format with ext4 below." -- Peterg4000 (talk) 23:32, 7 April 2015 (UTC)Reply
We needed something more generic and educational, I've added [1], I hope it's clear enough, please re-open the discussion if it's not :) — Kynikos (talk) 07:17, 8 April 2015 (UTC)Reply
Looks great. Loving the Arch way, community, Wiki etc. Cheers. -- Peterg4000 (talk) 08:49, 8 April 2015 (UTC)Reply
Actually, parted 3.2 has an explicit label for ext4:
(parted) help mkpart                                                      
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
...
        FS-TYPE is one of: btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp, linux-swap(v1), linux-swap(v0),
        ntfs, reiserfs, 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)
...
If they are all mapped to the same partition code is another matter, so I'm fine with the current wording. Alternatively we could leave out FS-TYPE completely, after all it is optional (but this is not reflected in the BG).
-- Lahwaacz (talk) 14:41, 8 April 2015 (UTC)Reply
Do we want to reopen and investigate this further? Thanks for reminding of the help command, however I can find many sources that seem to confirm that many Linux native file systems (but not all of the above!) map to 0x83: [2] [3] [4] [5] [6]. Unfortunately, as Wikipedia:Partition_type#Overview says, these codes are not standardized, so we won't be able to find an official reference. Last thing, quoting the manual, " fs-type is required for data partitions (i.e., non-extended partitions)", so I wouldn't leave it out as optional. — Kynikos (talk) 09:46, 9 April 2015 (UTC)Reply
The clearest would either be mkpart primary linux or mkpartfs ext4 but I doubt either is supported... -- Alad (talk) 12:47, 9 April 2015 (UTC)Reply
I doubt too, I've replaced the link to the manual with "help mkpart". — Kynikos (talk) 13:21, 10 April 2015 (UTC)Reply
I wasn't sure where to put this as I'm also new and it's really minor, but also in the parted section when making partitions it says to put 'm' for MiB, this should probably be updated as in my install just 'm' set my sizes to MB not MiB. Suggest updating or preferably instructing the user to define units when entering parted: so set units MiB or GiB or whatever so that just numbers can be used afterwards in creating partitions.Jjex22 (talk) 05:04, 27 August 2015 (UTC)Reply

exfatprogs vs exfat-utils and formatting to exfat

Usually on a fresh system when I install gparted I have exfat-utils, but that does not support formating to exfat (option is greyed out).

Instaling exfatprogs, which is in conflict with exfat-utils fixed that. Maybe important bit to add?

Pulec (talk) 10:30, 14 May 2022 (UTC)Reply

exfatprogs is an optional dependency of gparted. Nothing depends on exfat-utils. — Lahwaacz (talk) 06:18, 20 May 2022 (UTC)Reply

Lack of details to shrink partitions

Instructions are not clear in my opinion:

  • it'd be useful to have a little sentence on why we need to do all these commands. One can rightly ask themselves why isn't resize2fs enough?
  • at first I wasn't sure if the parted commands were needed only for btrfs or for ext2/3/4 as well (it ties with the previous point). A bit more clarification on what's common would be useful
  • there's no mention how to calculate the end value for parted. This is critical information (I think this link has correct instructions)
  • there's no reason why we should run resizepart command after the corresponding command is run inside parted. Maybe it was needed in the past, but after my research I couldn't find any evidence of it

Since I didn't want to mess up with all theose numbers, I came up with this version which uses fdisk (please note that the 2TB limitation has been resolved given it supports GPT, see note at the top of Fdisk):

Example on how to reduce the second partition to 200 GiB on /dev/nvme0n1:

  1. run resize2fs /dev/nvme0n1p2 200G
  2. run fdisk /dev/nvme0n1
  3. press d to enter the "delete partition" mode
  4. press 2 to delete the second partition
  5. follow steps in the Fdisk#Create_partitions wiki to create a new partition (keep first sector as default and write +200G for the last one)
  6. optional: run e2fsck -f /dev/nvme0n1p2 to check for errors

I'm writing this after running those commands to shrink my root partion. I know that this is a wiki for parted, but I don't think it's the preferred tool to safely and easily shrink a disk in my opinion. If it is, could someone please explain why? Thanks.

Mixin (talk) 21:15, 29 September 2023 (UTC)Reply