[ale] fun fun changing Linux swap partition to a swap file

Ron Frazier atllinuxenthinfo at c3energy.com
Thu Jan 20 13:22:52 EST 2011


Here's the output I get from various df commands:

ron at dell-i1525-1:~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2            100791728  32561064  63110668  35% /

ron at dell-i1525-1:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              97G   32G   61G  35% /

ron at dell-i1525-1:~$ df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda2              104G    34G    65G  35% /

Frankly, the number conversions are getting a bit confusing.  However,
the last two approximately agree with the numbers from Gparted and Disk
Utility.  So, it appears to me that I'm using the full partition without
having to resize the file system manually since I freed up 7-8 GB of
space when I removed the swap partition.

By the way, the man file for resize2fs says it cannot resize an ext4
file system online, but that could be out of date.

PS - Disk Utility does not ask for a password to start up, whereas
Gparted does.  I find that interesting.

Thanks for the help.

Sincerely,

Ron

On Thu, 2011-01-20 at 12:25 -0500, Michael B. Trausch wrote:
> On Thu, 2011-01-20 at 12:21 -0500, Ron Frazier wrote:
> > What I'm still wondering, though, is whether the file system is using
> > the full partition, or whether I have to move the fences, as Tim
> > suggested.  It's an ext4 file system, and I resized it with Gparted,
> > as described in the other post. 
> 
> Check the output of the 'df' command.  It will tell you the device the
> filesystem is on, the size (in 1 KiB blocks), how much is used, how much
> is available (again in 1 KiB blocks), the percentage used, and the
> mountpoint.
> 
> Your listing for 1 KiB blocks should match up pretty closely to what the
> filesystem's containing partition's size is.  It may not be exact.  But
> if you grew the partition by, say, 1 GB, and you're coming up 1 GB
> short, then the fix is pretty simple:
> 
>   sudo resize2fs /dev/device
> 
> Will resize the ext4 filesystem online.  It shouldn't take that long to
> do; longest I have seen it take is roughly 15 minutes for a growth of
> several tens of gigs.
> 
> 	--- Mike

-- 

(PS - If you email me and don't get a quick response, you might want to
call on the phone.  I get about 300 emails per day from alternate energy
mailing lists and such.  I don't always see new messages very quickly.)

Ron Frazier

770-205-9422 (O)   Leave a message.
linuxdude AT c3energy.com




More information about the Ale mailing list