LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-20-2006, 01:04 PM   #1
pickarooney
Member
 
Registered: Aug 2003
Distribution: (X)ubuntu Maverick
Posts: 152

Rep: Reputation: 15
Safe to resize used partitions?


I have a secondary data disk divided into a 140GB partition and a 60GB partition. The 60GB is currently empty and useless while the 140GB is almost full. Is it safe for me to unmount the disk and combine the partition with qtparted? Assuming I delete the smaller one, can I just make the larger one inactive and extend the size of it, or will I risk losing everything that's on it? If there's a risk, I can simply copy data from one partition to the other.
 
Old 12-20-2006, 01:12 PM   #2
xjlittle
Member
 
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
There's always risk whem moving partitions. You should always have a backup. That said I have never lost data doing it with one of the excellent partiotioning applications that linux offers. You are doing it in the best manner possible by unmounting the two partitions in question, deleting the unused on and expanding the larger one.

FWIW most catastrophes happen when shrinking a partition not when expanding them. Also I would look into using LVM or EVMS for disk management. They both handle this scenario very well.

hth
 
Old 12-24-2006, 09:00 AM   #3
pickarooney
Member
 
Registered: Aug 2003
Distribution: (X)ubuntu Maverick
Posts: 152

Original Poster
Rep: Reputation: 15
OK, finally got gparted to resize the partition after three crashes.
Luckily nothing seems to be lost. However, although gparted tells me that /dev/hdb1, mounted at /media/supersize is 189.92GB, bash, krusader etc. tell me that it's still 145GB. I tried umount and mount to see would it change the recognized size, but I think some info in fstab might be telling the OS how many blocks to mount at /dev/hdb1
I haven't rebooted yet, that said

Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda3
UUID=23cd75dd-8522-4cc8-8026-43d34facd54f /               ext3    defaults,errors=remount-ro 0       1
# /dev/sda1
UUID=38771644-df5d-4863-95ef-4abcf0a9c696 /boot           ext3    defaults        0       2
# /dev/sda4
UUID=6aca9cac-5354-4183-bf88-68e9e62bed9a /home           ext3    defaults        0       2
# /dev/hda6
UUID=f3466d96-c519-11d7-9a37-a027fa319c88 /media/oldhome  ext3    defaults        0       2
# /dev/hda7
UUID=bb8c5418-a024-4cc0-a287-4b1b083042af /media/oldsystem ext3    defaults        0       2
# /dev/hdb1
UUID=f084d777-e5ba-49df-b71b-729b2c0d2475 /media/supersize ext3    defaults        0       2
# /dev/sda5
UUID=7db0edf9-d00d-4b15-a5c3-c738a9091488 none            swap    sw              0       0
/dev/hdd        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/hdc        /media/cdrom1   udf,iso9660 user,noauto     0       0
 
Old 12-24-2006, 09:20 AM   #4
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Rep: Reputation: 31
Don't you need to resize the volume (not partition) too? I had the same problem with a NTFS Partition. It seems you need to use resize2fs. Look here

Do this at your own risk, I never tried.
 
Old 12-24-2006, 01:09 PM   #5
pickarooney
Member
 
Registered: Aug 2003
Distribution: (X)ubuntu Maverick
Posts: 152

Original Poster
Rep: Reputation: 15
From that link:
GNU Parted This program provides both filesystem and partition resizing at once, so it's easier to use than resize2fs. It's described in more detail shortly, in "Using GNU Parted."

I don't really understand the difference between a volume and a partition.

What's stranger yet is that gparted tells me that 175GB or 92% of the partition is in use, whereas there is really only an occupation of 131GB, according to df.

Last edited by pickarooney; 12-24-2006 at 01:13 PM.
 
Old 12-25-2006, 03:52 AM   #6
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Rep: Reputation: 31
I don't know the real difference between a volume and a partition, but there is one. I think it is the difference between allocated space and the space really used by the filesystem. Have you tried running resize2fs? It really sounds it is what you are looking for. See:

Quote:
The resize2fs program will resize ext2 or ext3 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 only.).
and

Quote:
The resize2fs program does not manipulate the size of partitions. If you wish to enlarge a filesystem, you must first make sure you can expand the size of the underlying partition first.
Try "man resize2fs" in console to get instruction how to use the programm. To resize /dev/hdb1 type as root:

Quote:
resize2fs -p /dev/hdb1

Last edited by hansalfredche; 12-25-2006 at 04:05 AM.
 
Old 12-25-2006, 06:10 AM   #7
pickarooney
Member
 
Registered: Aug 2003
Distribution: (X)ubuntu Maverick
Posts: 152

Original Poster
Rep: Reputation: 15
Yes! perfect Thanks hansalfredche. I should have listened to you the first time
 
  


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
Hoe safe to resize partitions? heffo_j Linux - Hardware 2 07-02-2006 10:04 AM
are partitions safe? cilcit Linux - Newbie 5 08-29-2005 10:10 AM
Safe to resize linux partition? Mackentack Linux - Newbie 4 05-02-2005 06:18 AM
Safe to resize root partition with PM8? Ohmn Mandriva 6 07-09-2004 09:29 AM
resize partitions wolfe2554 Linux - General 1 07-05-2004 08:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07: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
Open Source Consulting | Domain Registration