LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-26-2017, 08:26 AM   #1
brodo
Member
 
Registered: Jan 2004
Location: Poland, Poznan
Distribution: Slackware current 32 / 64
Posts: 406

Rep: Reputation: 30
How can I painlessly enlarge my sda1 boot partition ?


Hi folks,

I have a cryptsetup-lvm-encrypted HDD where SW-current resides. It has 2 partitions : sda1 as /boot and sda2 as the encrypted rest of the system (root, home).

Now I see that sda1 (50MB) is too small to handle the necessary kernel upgrades.

How can I enlage it to 100MB or so without reinstalling all partitions from scratch ?
 
Old 10-26-2017, 09:46 AM   #2
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 627

Rep: Reputation: Disabled
You can't. You could try shrinking sda2 enough to create sda3 for boot if you still have space on sda2.
That would leave you with an empty 50mb on sda1.
 
Old 10-26-2017, 11:00 AM   #3
Gordie
Member
 
Registered: Aug 2007
Location: Nolalu, Ontario, Canada
Distribution: Slackware64-Current
Posts: 871

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
Back in the day I used Partition Magic to do just what you want to do. I had a look at gparted and see that it can resize unmounted partitions sooooo I would prepare a Slackware Live dvd and use it to run gparted on your (now unmounted) hard drive and resize
 
Old 10-26-2017, 12:15 PM   #4
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 627

Rep: Reputation: Disabled
You can resize a partition and make it smaller and if there is space after a partiton you can extend it. You can't do exactly what you require without formatting your sda2 and extending into the space.
 
Old 10-26-2017, 01:18 PM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I'm not a Slackware user, but if it works like other linux distributions I'm familiar with...

The most painless solution would be to create a new /boot partition on a USB thumbdrive and reconfigure/reinstall grub (or whatever boot loader you're using).

I don't know the Slackware way of doing this. I know how to do it with Debian, but I expect it may be significantly different in Slackware.
 
Old 10-26-2017, 01:30 PM   #6
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
I think you're all missing the point that sda2 is encrypted lvm, and therefore simply resizing sda2 will destroy the logical volumes inside it.

I think brodo needs to boot from USB or DVD or PXE, then unlock sda2, then resize each LVM filesystem, then resize each LVM logical volume, then resize the LVM physical volume, then resize the LUKS volume, then resize (and move) the sda2 partition, then resize the sda1 boot partition. Something like this: https://wiki.archlinux.org/index.php...ng_LVM-on-LUKS

It will not be painless and you will need good backups
 
2 members found this post helpful.
Old 10-26-2017, 02:24 PM   #7
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I didn't miss that point, FWIW. That's why I suggest migrating /boot to a USB thumbdrive. It's the most painless solution because it doesn't require modifying any partitioning or LVM volumes on sda.
 
Old 10-26-2017, 02:29 PM   #8
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by IsaacKuo View Post
I didn't miss that point, FWIW. That's why I suggest migrating /boot to a USB thumbdrive.
And I wasn't implicitly disrespecting your idea, FWIW, because your post wasn't there yet when I started to reply.
 
Old 10-26-2017, 03:48 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,124

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I attempted similar a while back - not Slack, but that shouldn't matter in the grand scheme of things.
Resizing is relatively straight-forward, but you have to be careful - resize filesystem, lv,pv, crypt container. Then do the partition and get all the offsets correct.
Of course that puts the free space at the wrong end. No problem, Use that as /boot instead - if your BIOS allows that; these days shouldn't be a problem. I was on a UEFI system so moved the EFI partition to the free space. Was never able to get grub to boot completely - maybe I got the initramfs hooks wrong.

Gave up, zapped the entire disk, and treated it as a lesson learned.
YMMV.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enlarge logical partition in linux? Wonder Linux - Newbie 3 08-18-2011 01:05 AM
[SOLVED] enlarge /dev/sda1 th1bill Ubuntu 2 07-08-2011 04:17 PM
extended sata partition shrunk at 15 partition limit, how to re-enlarge Siljrath Linux - General 3 06-02-2010 10:33 PM
Enlarge extended partition fawrell Linux - General 4 07-31-2008 02:08 AM
How to enlarge my Linux partition westspider Linux - Software 3 03-22-2005 05:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration