You are not logged in.

#1 2013-01-28 12:36:14

bslackr
Member
Registered: 2012-01-27
Posts: 131

Resizing Partitions

I've recently decided to start trying out different kernels, but my /boot partition is only 50MiB so I need to make it bigger. My root is a logical volume on a luks encrypted partition, and I also have windows installed on this drive. /home is on a different drive so that isn't an issue. My partition scheme is like this

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          391167   190.0 MiB   EF00  <--- EFI Partition
   2          391168          493567   50.0 MiB    8300  Linux filesystem <-- /boot
   3          493568        94865407   45.0 GiB    8300  Linux filesystem <--- luks
   4        94865408       207816703   53.9 GiB    0700  Basic data partition <-- Windows
   5       207816704       208078847   128.0 MiB   0C01  Microsoft reserved part 

My question is, what would be the easiest way to do this? I was thinking of resizing and moving the windows partition by 200MiB or so, and then moving the luks partition. The other option would be to attempt to resize the luks partition, but last time I tried to resize a luks partition it was more of a hassle than was worth it and ended up just backing up the data and deleting it.

I haven't done much with moving partitions though, and most of the guides that I've found with google talk about using gparted. I prefer doing things from the commandline and have had some less-than-desireable moments using GUIs to manage disks, using fdisk/gdisk mostly. Can I do this in gdisk? The only thing in the manual about resizing is resizing the partition table.

Offline

#2 2013-01-28 16:49:34

PaulBx1
Member
Registered: 2008-10-18
Posts: 142

Re: Resizing Partitions

Before I do anything touchy like this, I always boot Puppy Linux off DVD or flash drive (so sda is not mounted) and use dd piped to gzip to do an image backup to a USB drive. I also do that before pacman -Syu. That way if anything gets borked, recovery is easy.

Also I've lately started to create partitions with significant unused space between them, when I lay out a drive. Drives are so large it's no big deal, and it allows more flexibility if anything needs to be resized. First step is to write the entire drive with zeros so the empty spaces compress well in dd backups. The only drawback is increased seek times, but the drive I'm using is solid state so those are zero in any case.

I've had good luck with gparted, but I think there was some problem with NTFS after Windows 7; after using gparted it made Windows unbootable and you had to use a Windows DVD to get it running again. It's possible that problem has been fixed already though.

Last edited by PaulBx1 (2013-01-28 16:57:21)

Offline

#3 2013-01-28 17:55:38

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 3,437
Website

Re: Resizing Partitions

bslackr wrote:

I haven't done much with moving partitions though, and most of the guides that I've found with google talk about using gparted. I prefer doing things from the commandline and have had some less-than-desireable moments using GUIs to manage disks, using fdisk/gdisk mostly. Can I do this in gdisk? The only thing in the manual about resizing is resizing the partition table.

How did you setup the LVM drives initially? If you want to use the command line, I assume you would use a combination of the pv*, vg*, and lv* suite of tools.

Offline

#4 2013-01-28 22:08:33

bslackr
Member
Registered: 2012-01-27
Posts: 131

Re: Resizing Partitions

drcouzelis wrote:
bslackr wrote:

I haven't done much with moving partitions though, and most of the guides that I've found with google talk about using gparted. I prefer doing things from the commandline and have had some less-than-desireable moments using GUIs to manage disks, using fdisk/gdisk mostly. Can I do this in gdisk? The only thing in the manual about resizing is resizing the partition table.

How did you setup the LVM drives initially? If you want to use the command line, I assume you would use a combination of the pv*, vg*, and lv* suite of tools.

Correct. cryptsetup unlocks the partition to /dev/mapper/syscrypt. I then did the following:

pvcreate /dev/mapper/syscrypt
vgcreate sysvg /dev/mapper/syscrypt
lvcreate -n swap -L 4G sysvg
lvcreate -n root -l 100%FREE sysvg

I then used mkfs.ext4 and mkswap on them. I have plenty of free space on my root volume, and I hear it is easy resizing logical volumes, it is just the encryption overtop it that gets tricky.

drcouzelis wrote:

Before I do anything touchy like this, I always boot Puppy Linux off DVD or flash drive (so sda is not mounted) and use dd piped to gzip to do an image backup to a USB drive. I also do that before pacman -Syu. That way if anything gets borked, recovery is easy.

Good idea, I'll do that.

drcouzelis wrote:

I've had good luck with gparted, but I think there was some problem with NTFS after Windows 7; after using gparted it made Windows unbootable and you had to use a Windows DVD to get it running again. It's possible that problem has been fixed already though.

Yeah, I haven't had much success with using gparted + Win7 and GPT partitions. I haven't tried using it in a while, but I am reluctant to because of past experiences.

Last edited by bslackr (2013-01-28 22:11:14)

Offline

Board footer

Powered by FluxBB