Le 24/07/2017 à 16:13, solitone a écrit :
I never use MacOs, so I want to just keep debian, so at least I'll put its 22
GB space to better use. I used to keep it just for some sporadic firmware
update, but frankly I don't think I'll need this again in the future.
~$ sudo /sbin/parted /dev/sda print
Model: ATA APPLE SSD SM0128 (scsi)
Disk /dev/sda: 121GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 20.5kB 210MB 210MB fat32 EFI System Partition boot,
esp
2 210MB 22.6GB 22.4GB hfs+
3 22.6GB 23.2GB 650MB hfs+
4 23.2GB 31.2GB 8000MB linux-swap(v1) swap
5 31.4GB 121GB 89.8GB ext4 linux
I would use parted from the installation media to delete partitions 1-4,
recreate the swap at the start (unless I decide to usa a file for the swap),
and move/extend the ext4 partition.
AFAIK, parted (the command line program) cannot move the start of a
partition and its contents. Only gparted (the GUI program) can.
With LVM you could have just created a new partition, use it as a
physical volume (PV) to extend the volume group (VG) and use the new
available space to extend or create logical volumes (LV).
With btrfs instead of ext4, you could have used a new partition to
extend the existing filesystem.
This seems a bit risky, though. I already asked this, but is there a way to
completely backup my current system, so that I could quickly restore it on a
blank new partition, in case everything goes wrong?
There are two main ways :
- create an image of the partition with dd, partclone, partimage,
clonezilla... (it must not be mounted read/write)
- back up the filesystem contents with cp -a, rsync...
The image has the advantage of saving the filesystem metadata (UUID,
LABEL...)