LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-28-2014, 10:20 AM   #1
Mercury305
Member
 
Registered: Jul 2012
Location: Rockville, MD
Distribution: CrunchBang / Ubuntu
Posts: 540

Rep: Reputation: Disabled
resize2fs


So I got a GPT disk that has a total of 3TB on it with 2 partitions.
Partition 1 = EXT4 (2TB)
Partition 2 = NTFS (1TB)
I deleted the NTFS partition using "parted" and now have 1 TB freespace to extend Partition 1.

However, using resize2fs I get this:

Code:
# resize2fs /dev/sdc1
resize2fs 1.42.5 (29-Jul-2012)
The filesystem is already 536857600 blocks long.  Nothing to do!
Anyone know what I am doing wrong?

Thanks.
 
Old 05-28-2014, 10:43 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
You never enlarged the partition where the filesystem resides. Tools like gparted will enlarge the partition and filesystem at the same time. If you want to do it manually, the steps are:
  1. Note where partition 1 currently starts. Use a partitioning tool that reports in "sector" units so that you get an exact number.
  2. Delete both partition 1 and partition 2, then re-create partition 1 starting at the same point noted in Step 1 and continuing to the end of the disk.
  3. If you are doing this while the drive is in use by the OS, you will now need to reboot to get the kernel to use the new partitioning.
  4. Run resize2fs to resize the filesystem to fill its enlarged partition.
Resizing a filesystem always has the potential for disaster. Be sure you have a good backup before starting.
 
Old 05-28-2014, 11:09 AM   #3
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,129
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by rknichols View Post
You never enlarged the partition where the filesystem resides. Tools like gparted will enlarge the partition and filesystem at the same time. If you want to do it manually, the steps are:
  1. Note where partition 1 currently starts. Use a partitioning tool that reports in "sector" units so that you get an exact number.
  2. Delete both partition 1 and partition 2, then re-create partition 1 starting at the same point noted in Step 1 and continuing to the end of the disk.
  3. If you are doing this while the drive is in use by the OS, you will now need to reboot to get the kernel to use the new partitioning.
  4. Run resize2fs to resize the filesystem to fill its enlarged partition.
Resizing a filesystem always has the potential for disaster. Be sure you have a good backup before starting.
What if he uses partprobe?
 
Old 05-28-2014, 02:30 PM   #4
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
Generic instructions:

Add or expand the partition
Expand filesystem

In an LVM situation, you:

Add/expand the partition
Add to the pv
Add to the vg
Add/expand the lv
Expand the filesystem

We all have our favorite tools, so I won't suggest specific commands or tools be used.
 
Old 06-23-2014, 08:38 AM   #5
Mercury305
Member
 
Registered: Jul 2012
Location: Rockville, MD
Distribution: CrunchBang / Ubuntu
Posts: 540

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
You never enlarged the partition where the filesystem resides. Tools like gparted will enlarge the partition and filesystem at the same time. If you want to do it manually, the steps are:
  1. Note where partition 1 currently starts. Use a partitioning tool that reports in "sector" units so that you get an exact number.
  2. Delete both partition 1 and partition 2, then re-create partition 1 starting at the same point noted in Step 1 and continuing to the end of the disk.
  3. If you are doing this while the drive is in use by the OS, you will now need to reboot to get the kernel to use the new partitioning.
  4. Run resize2fs to resize the filesystem to fill its enlarged partition.
Resizing a filesystem always has the potential for disaster. Be sure you have a good backup before starting.
It seems that the GPT was corrupted so I basically had to tar a backup on another drive then untared into the new drive.
I am assuming this must have been the safest thing for me to do?
 
Old 06-23-2014, 09:42 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by Mercury305 View Post
It seems that the GPT was corrupted so I basically had to tar a backup on another drive then untared into the new drive.
I am assuming this must have been the safest thing for me to do?
That is certainly the solution with the simplest steps. While partitioning problems almost always can be resolved without copying masses of data, doing so requires carrying out several steps very precisely, and really you should have the full backup available anyway.

Glad to hear you got things straightened out.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tune2fs and resize2fs (LVM) guixingyi Linux - Server 2 09-12-2013 05:24 AM
resize2fs equivalent for btrfs? Konphine Linux - Software 2 01-30-2012 09:25 PM
resize2fs command ikpreet Linux - Newbie 6 06-24-2011 06:29 AM
Is resize2fs safe? Clemente Linux - Server 5 09-02-2008 05:18 PM
resize2fs nooch Red Hat 2 02-25-2005 09:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:31 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