Resize partition with parted
Hello,
I have a partition, which is 32GB and is mounted to / of the archlinux distribution. I want to create another partition, I need about 5GB and I want to take them from this partition. If I use parted to resize the partition will I lose any files? Thank you |
Now resizing the partitions without losing data is possible, But you have to move carefully.
First shrink your filesystem. check man resize2fs for ext2/3/4 and man resize_reiserfs. they are pretty simple to use but live resize may not be supported on your system, though Code:
fsck -f $PARTITION after that use parted to resize partition with size 27G. Thick here is that new partition's starting point must be same as old partition. Take a note if you need to. If in doubt, post your commands before running here first. |
Are you sure it's fsck -f? I read the man page and I cannot find a -f argument
|
-f forces to check clean file systems and it's actually option of what fsck runs for actual file system checking.
|
Ok, i have done fsck and resize2fs.
Now what should i do with parted? This is the partition table, number 2 is the partition to be resized: Code:
Number Start End Size Type File system Flags |
Code:
(parted) print Code:
(parted) resize 2 $NUM2 $NEWEND Before jumping to running the commnads, read help resize for figuring out right numbers. |
All times are GMT -5. The time now is 05:37 PM. |