You are not logged in.

#1 2010-05-18 15:53:14

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

[Canceled] Resizing ext4 and adding space to swap

Ok, so without any intros, here's my fdisk:

Disk /dev/sda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x41de41dd

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1216     9767488+  83  Linux
/dev/sda2            1217        1338      979965   82  Linux swap / Solaris
/dev/sda3            1339        7297    47865667+  83  Linux

I want to resize sda1 by taking 500MB off of it and adding that amount to sda2 (swap, for hibernation needs). Can I use a GParted software found on the new ubuntu live cd? Anyone did the same thing recently? Any chances of corrupting the partition?

sda1 is /
sda2 is swap
sda3 is /home

Will their UUIDs change? I have UUIDs in grub entries only. fstab has /dev/sdXs only.

Thanks! smile

Last edited by archman-cro (2010-05-21 15:20:47)

Offline

#2 2010-05-18 17:15:07

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [Canceled] Resizing ext4 and adding space to swap

iirc it depends on the filesystem. some won't allow resizing. gparted is the right tool though.


no place like /home
github

Offline

#3 2010-05-19 21:24:38

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Canceled] Resizing ext4 and adding space to swap

Noone really resized ext4 lately? Any impressions?

Offline

#4 2010-05-19 21:38:02

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: [Canceled] Resizing ext4 and adding space to swap

I resized my ext4 partition yesterday using Parted Magic http://partedmagic.com/ without any issues.  My setup was pretty much identical to yours. Didn't notice any changes to UUIDs, it just rebooted like normal.

There's ALWAYS a chance of corruption wink  Just make sure to backup first.

Offline

#5 2010-05-19 22:23:59

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [Canceled] Resizing ext4 and adding space to swap

I resized ext4 using GParted once. No problem though a bit time consuming.

Offline

#6 2010-05-19 22:24:26

Blue Peppers
Member
From: Newbury, UK
Registered: 2009-02-01
Posts: 178

Re: [Canceled] Resizing ext4 and adding space to swap

I did it today. It went fine. I use labels however, as I find them much easier. Typing LABEL=Root is much easier than UUID=some_random_20ish_digit_string


Consistency is not a virtue.

Offline

#7 2010-05-20 00:29:01

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [Canceled] Resizing ext4 and adding space to swap

You don't have to use gparted - you can use resize2fs to handle the filesystem, and then (c)fdisk to do the partitions.

Also, straying off the topic slightly, you could use a swapfile instead of a swap partition - much easier to resize for hibernation purposes. I installed extra ram a while ago, so I just bumped up my swapfile by the required amount, no messing with existing partitions.

Offline

#8 2010-05-20 00:34:34

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: [Canceled] Resizing ext4 and adding space to swap

tomk wrote:

You don't have to use gparted - you can use resize2fs to handle the filesystem, and then (c)fdisk to do the partitions.

Also, straying off the topic slightly, you could use a swapfile instead of a swap partition - much easier to resize for hibernation purposes. I installed extra ram a while ago, so I just bumped up my swapfile by the required amount, no messing with existing partitions.

QFT.
Swapfiles ftw.

Offline

#9 2010-05-20 01:10:37

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: [Canceled] Resizing ext4 and adding space to swap

Well, I did get partition corruption (grub wouldn't boot, and would hang on that partition even though I could mount it from the livecd and see the contents) once, but the previous 2 times worked just fine smile.

YMMV


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#10 2010-05-20 08:33:27

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Canceled] Resizing ext4 and adding space to swap

@ tomk: AAh, using swap file. Nice, actually! As the swap partition is never used on my system. I will try this method with TuxOnIce first, and then I'll see.

So I just remove the swap partition and add it to the next or previous partition?
(marking as "solved")

Thanks, guys. smile

Offline

#11 2010-05-20 09:11:07

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Canceled] Resizing ext4 and adding space to swap

Update: Ewww, the pc crashes when doing a swapfile with hibernate --no-suspend as root, tried on both ext4 partitions. Apparently, it seems like it crashes after making the swapfile, before exiting the command. I can't find anything useful in errors.log or everything.log either. sad
Maybe I should try removing the entry in /sys/power/tuxonice/resume ? (There's a swap partition entry in it.)

Offline

#12 2010-05-21 15:20:31

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Canceled] Resizing ext4 and adding space to swap

I have posted a bug on Bugzilla of TuxOnIce. Editing the thread status to "Canceled".

Offline

#13 2010-05-21 18:23:52

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [Canceled] Resizing ext4 and adding space to swap

Does the tuxonice documentation help? There's a section there about using swapfiles for hibernation.

Offline

#14 2010-05-21 20:30:35

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Canceled] Resizing ext4 and adding space to swap

No, unfortunately not. :S This seems like it's a "new" problem, since there's zero reports about it.

Here's a bug link: http://bugzilla.tuxonice.net/show_bug.cgi?id=454

Offline

Board footer

Powered by FluxBB