LinuxQuestions.org
Visit the LQ Articles and Editorials section
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-08-2010, 10:49 PM   #1
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Rep: Reputation: 50
Help resizing Ext4 partition size


Mis-allocated 10g instead of 30g to /var/lib/mysql and realized mistake After Fresh Install and upgraded all servers.
Using Slackware13.1, Xfce did some googling wondering if its possible to resize the above partition with fdisk. Read some things about gparted and wonder if it will work using Xfce.. i've never use kde or gnome. There is also mention of using live cd; I have no experience with any of the mentioned tools; just fdisk to partition and install.
What is the best or simplest way to backup & restore; (I do have an empty sdb 160g but don't want to get into complicated raid or LVM setups right now because I still have to learn howto backup & restore do data to the point where I feel comfortable with it)?

Current setup: sda 160gb Hdd used 73.5 for following partitions:
sda1 512m /boot; sda2 Extended Rest of Hdd; sda5 1280m /swap; sda6 8g /home; sda7 2g /; sda8 8g /usr; sda9 8g /usr/local; sda10 10g /var; sda11 10g /var/log; *sda12 10g instead of 30g /var/lib/mysql; sda13 10g /opt; sda14 5g /tmp
Haven't configure mysql... so /dev/sda12 is empty except for system disk data the same goes for /dev/sda13 /opt & /dev/sda14 /tmp

Last edited by NightSky; 10-08-2010 at 10:52 PM.
 
Old 10-09-2010, 02:18 AM   #2
maxmiorim
Member
 
Registered: Sep 2010
Location: Brazil
Distribution: Slackware
Posts: 43

Rep: Reputation: 8
Gparted will work fine in XFCE, it's not _that_ reliant on GNOME if memory serves me right (in fact, it seems to be just another GTK application, like most of things that you'd use in XFCE).

Alternativelly, there's parted, which does the same thing using a command line interface.

Also, you could:
0 - dump /dev/sda12, /dev/sda13 and /dev/sda14 data using tar, rsync or even cp (or just ignore this, as you said they don't have anything yet)
1 - boot with a livecd (or umount /dev/sda12, /dev/sda13 and /dev/sda14 if you feel brave enough to change the partition table with your system running
2 - fdisk /dev/sda and delete /dev/sda12, /dev/sda13 and /dev/sda14
3 - recreate them, with the proper sizes
4 - format and mount them
5 - restore the data
6 - reboot into your slackware (if you used the livecd)


As for the LVM, it's far easier than you think. In fact, it requires less than 10 commands to set up LVM during Slackware installation (see README_LVM.TXT) and it'd be much simpler to resize the partitions (umount, fsck, lvresize or lvexpand or lvreduce, resize2fs, mount), not to mention that it could be done without the need to touch the partition table.

Last edited by maxmiorim; 10-09-2010 at 02:24 AM.
 
1 members found this post helpful.
Old 10-09-2010, 12:44 PM   #3
BrZ
Member
 
Registered: Apr 2009
Distribution: Slackware
Posts: 505

Rep: Reputation: 85
I like PartedMagic (http://partedmagic.com/) running from usb flash drive. I think you'll need UNetbootin for the latest 5.x PartedMagic iso. Built mine (v4.8.5) with this script


edit: for version 4.9.1 you may change the script:
CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
sed -i '/^RESOURCES/d' unetbootin.pro
lupdate unetbootin.pro || exit 1
lrelease unetbootin.pro || exit 1
qmake "DEFINES += NOSTATIC" "RESOURCES -= unetbootin.qrc" || exit 1
make || exit 1

Last edited by BrZ; 10-09-2010 at 01:10 PM.
 
Old 10-09-2010, 09:04 PM   #4
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Original Poster
Rep: Reputation: 50
Thank you.. trying to decide where to go from here on that box. Could I just use the slackware13.1 install disk to get around mounting existing partitions and then do fdisk on the last 3 partitions, they are extended logical partitions you know?
maxmiorim, what would you do exactly? Can I create LVMs from the current setup I have? What about data recovery with LVMs read its really difficult?
 
Old 11-11-2010, 05:02 PM   #5
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Original Poster
Rep: Reputation: 50
Help Clarify Actual Partition Size Discrepancy

Downloaded Gparted 7.0 Live CD and it works fine on slackware13.1. Oddly GUI opens with Debian Logo? Why is that? Discovered Partition table for /hda12 Displays 30gb ??? which means I originally partitioned it correctly but when I run:
Code:
df -h
Partition shows up as 9.2gb
When I look at GUI File System Directory and highlight /var/lib/mysql for properties:
Volume is 32GB Free Space 9.2GB
Why the Partition Size Info Discrepancy? How can I fix this, should I rewrite the partition table with Gparted? Thanks

Last edited by NightSky; 11-11-2010 at 05:05 PM.
 
Old 11-11-2010, 05:32 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,858

Rep: Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166
Lots of bits of incomplete data. Run these and post all the output (presumes /dev/sda is actually correct)
Code:
parted -l /dev/sda
df -hT
 
Old 11-11-2010, 06:37 PM   #7
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Original Poster
Rep: Reputation: 50
Thanks syg00
Code:
bash-4.1$ df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/root     ext4    2.0G  269M  1.7G  14% /
/dev/sda8     ext4    7.9G  3.4G  4.2G  46% /usr
/dev/sda6     ext4    7.9G  310M  7.2G   5% /home
/dev/sda9     ext4    7.9G  147M  7.4G   2% /usr/local
/dev/sda1     ext4    510M   24M  461M   5% /boot
/dev/sda14    ext4    5.0G  139M  4.6G   3% /tmp
/dev/sda13    ext4    9.9G  151M  9.3G   2% /opt
/dev/sda12    ext4    9.9G  207M  9.2G   3% /var/lib/mysql
/dev/sda11    ext4    9.9G  207M  9.2G   3% /var/log
/dev/sda10    ext4    9.9G  207M  9.2G   3% /var
tmpfs        tmpfs    311M     0  311M   0% /dev/shm
Only have the Gparted Live CD. No Parted installed so this:
Code:
parted -l /dev/sda
doesn't work. Can you tell me howto use Gparted Live CD to get info you requested? Thanks
 
Old 11-11-2010, 11:42 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,858

Rep: Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166
Doesn't work (as in command not found) or doesn't return anything at all. If the latter try as root/sudo.
Else use "fdisk -l" - might need root as well.
 
1 members found this post helpful.
Old 11-12-2010, 12:46 AM   #9
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by BrZ View Post
I like PartedMagic (http://partedmagic.com/) running from usb flash drive. I think you'll need UNetbootin for the latest 5.x PartedMagic iso.
The latest PartedMagic is a hybrid ISO/Disk image.

It can be written directly to a usb drive like:
Code:
dd if=pmagic-5.6.iso of=/dev/sdX
Or:
Code:
cat pmagic-5.6.iso > /dev/sdX
I see the OP already downloaded the gparted live cd, but I thought you might like to know since it's faster than installing Unetbootin/the latest Syslinux (latest pmagic's syslinux.cfg uses features not found in Slackware's version of Syslinux)

Last edited by piratesmack; 11-12-2010 at 12:53 AM.
 
Old 11-12-2010, 02:30 AM   #10
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Original Poster
Rep: Reputation: 50
Thanks will download and try parted magic too. Here is HDD information requested, syg00 it worked! initially it was command not found. First time working on creating custom partitions. Didn't even know I had "parted tools installed"

Code:
bash-4.1$ su
Password: 
bash-4.1# parted -l /dev/sda
Model: ATA ST3160812A (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      32.3kB  543MB   543MB   primary   ext4
 2      543MB   160GB   159GB   extended
 5      543MB   1892MB  1349MB  logical   linux-swap(v1)
 6      1892MB  10.5GB  8595MB  logical   ext4
 7      10.5GB  12.6GB  2155MB  logical   ext4
 8      12.6GB  21.2GB  8595MB  logical   ext4
 9      21.2GB  29.8GB  8595MB  logical   ext4
10      29.8GB  40.6GB  10.7GB  logical   ext4
11      40.6GB  51.3GB  10.7GB  logical   ext4
12      51.3GB  83.5GB  32.2GB  logical   ext4
13      83.5GB  94.3GB  10.7GB  logical   ext4
14      94.3GB  99.7GB  5379MB  logical   ext4


Model: ATA ST3160023A (scsi)
Disk /dev/sdb: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags


Error: /dev/md0: unrecognised disk label                                  
Warning: Error fsyncing/closing /dev/md0: Input/output error              
Retry/Ignore? Ignore
*(Not running raid. Disk /dev/sdb is just empty second hdd I had).

Last edited by NightSky; 11-12-2010 at 02:41 AM.
 
Old 11-12-2010, 03:13 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,858

Rep: Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166
Run fsck then resize2fs on /dev/sda12. The resize will expand to fill the partition by default.
Works online, but I prefer to umount first.
 
Old 11-12-2010, 01:16 PM   #12
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Original Poster
Rep: Reputation: 50
Wink Partition Size didn't work properly during initial setup

syg00,
Ran fsck /dev/sda12 and got this:
Code:
bash-4.1# fsck /dev/sda12
fsck from util-linux-ng 2.17.2
e2fsck 1.41.11 (14-Mar-2010)
/sbin/e2fsck: Device or resource busy while trying to open /dev/sda12
Filesystem mounted or opened exclusively by another program?
Should I use Gparted Live CD to run those commands? Or should do this? Is this correct? Appreciate your time
Code:
#umount /dev/sda12
#fsck /dev/sda12
#resizefs2fs
Forgot if I used journaling option during initial partitioning, How do I check to see if I used it?

Wonder why standard fsdisk /dev/sda12 sizing partition during install failed? Any ideas,tips, tricks? Many Thanks to you

Last edited by NightSky; 11-12-2010 at 01:56 PM. Reason: Don't understand result of fsck + Forgot if I used journaling option
 
Old 11-12-2010, 03:01 PM   #13
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Original Poster
Rep: Reputation: 50
Why is my Partition Table:msdos
Why is making /dev/sda12 (/var/lib/mysql)busy or opened exclusively by another program? HAL? mysql starting up at boot time? I don't understand this?
Did
Code:
#umount /dev/sda12
#fsck /dev/sda12
No joy.
 
Old 11-12-2010, 03:42 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,858

Rep: Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166
Using a liveCD would certainly be easiest.
umount accepts a mountpoint, not a device.
fdisk resizing did work, as can be seen from the parted display. It works on partitions - the filesystem within it (fdisk) neither knows nor cares about.
ext4 (filesystem, not partition) will almost certainly be journalled - you can check with tune2fs -l.

My comment about working online was in reference to the resize - fsck should always be run against umounted filesystems.
 
Old 11-13-2010, 09:59 PM   #15
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 777

Original Poster
Rep: Reputation: 50
Question Why does df -hT continue to displaying wrong partition size for /dev/sda12?

Tried:
Code:
#umount /var/lib/mysql 
umount: /var/lib/mysql: not mounted
# fsck  /dev/sda12
fsck from util-linux-ng 2.17.2
e2fsck 1.41.11 (14-Mar-2010)
/sbin/e2fsck: Device or resource busy while trying to open /dev/sda12
Filesystem mounted or opened exclusively by another program?
# tune2fs /dev/sda12 -l
tune2fs 1.41.11 (14-Mar-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          3c2bdb57-fc90-4a0c-997a-6336a5164c61
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              1966560
Block count:              7865817
Reserved block count:     393290
Free blocks:              7698376
Free inodes:              1966549
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1022
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8160
Inode blocks per group:   510
Flex block group size:    16
Filesystem created:       Mon Oct  4 10:59:32 2010
Last mount time:          Sat Nov 13 21:32:02 2010
Last write time:          Sat Nov 13 21:32:02 2010
Mount count:              1
Maximum mount count:      39
Last checked:             Sat Nov 13 11:31:39 2010
Check interval:           15552000 (6 months)
Next check after:         Thu May 12 12:31:39 2011
Lifetime writes:          613 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:	          256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      bbdf1b21-8197-4540-a007-842dcd47aa57
Journal backup:           inode blocks
fsck using Gparted Live CD and still df command reports 9.2gb partition size. Haven't configured myql yet because of the partition size discrepancy. Is it an ext4 issue? I'm at a loss here. What does this mean "has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize"?
Now the df -hT command displays the correct partition size sometimes? This is not stable enough to setup mysql on is it?

Last edited by NightSky; 11-13-2010 at 10:08 PM. Reason: df -ht command now shows correct partition size sometimes
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Upgrading Redhat to support ext4 for files over 2TB in size rog_ski Linux - General 7 09-28-2010 09:27 AM
correct partition size not reported after resizing with gparted rogerdv Linux - General 5 01-11-2010 10:35 AM
Ext4 partition corrupted by resized NTFS Vista C:\ partition? graviton-boson Linux - Newbie 2 03-16-2009 01:26 PM
URGENT! Resizing NTFS partition size problems. rconan Linux - Software 3 09-03-2005 12:03 PM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM


All times are GMT -5. The time now is 03:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration