Using parted

It is useful to be able to use parted from the command line when you need to change partitioning from the SUSE Rescue System. You might need to do this because you want to reclaim disk space from a partition that has empty space on it, but that has to be mounted in the running system (as / or /usr, for example).

In that case, you boot from the installation medium and choose Rescue System from the boot menu. You can then log in as root (without a password) to a Linux system running in memory: None of the partitions will be mounted. parted offers you a prompt like this: (parted). To get help, type help or ?. In the example that follows, we list (print) the partitions on /dev/sdc and then resize the second partition. The parted command resize 2 6677 8000 moves the end of the second partition from its current position at 8307 to 8000, while leaving the start of the partition unchanged.

# parted /dev/sdc (parted) print

Disk geometry for /dev/sdc: 0.000-14324.625 megabytes Disk label type: msdos

Minor Start End Type Filesystem Flags

1 0.016 4042.000 primary fat32 lba, type=0c

2 6677.000 8307.000 primary ext2 type=83

3 8307.000 14324.000 primary reiserfs type=83 (parted) resize 2 6677 8000

parted enables you to copy a filesystem from a partition onto another partition and can create a filesystem on the partition as soon as it creates the partition.

Was this article helpful?

0 0

Post a comment