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.
Resizepart command was removed in version 3.0
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'.
Linked to 'parted' Manual doesn't list ext3 or ext4 for fs-type
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)
- 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) mkpartshouldn'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)
- 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)
- 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)
- Actually, parted 3.2 has an explicit label for ext4:
- 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:     . 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)
- 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)
exfatprogs vs exfat-utils and formatting to exfat
Usually on a fresh system when I installI have , but that does not support formating to exfat (option is greyed out).
Instaling, which is in conflict with fixed that. Maybe important bit to add?
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
- at first I wasn't sure if the
partedcommands were needed only for
ext2/3/4as 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
parted. This is critical information (I think this link has correct instructions)
- there's no reason why we should run
resizepartcommand 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
resize2fs /dev/nvme0n1p2 200G
dto enter the "delete partition" mode
2to delete the second partition
- follow steps in the Fdisk#Create_partitions wiki to create a new partition (keep first sector as default and write
+200Gfor the last one)
- optional: run
e2fsck -f /dev/nvme0n1p2to 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.