LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-23-2010, 08:54 PM   #1
albertwt
Member
 
Registered: Aug 2010
Posts: 50

Rep: Reputation: 1
Question How to extend the Ubuntu Linux hard disk size to use full capacity ?


Hi All,

I wonder if this is possible to extend or regrow the Linux hard disk partition from 8 GB to 20 GB without losing the existing data on the partition ?

at the moment this Ubuntu Linux is deployed on top of VMware and I've just regrow the hard drive from 8 GB into 20 GB but can't see the effect immediately.

can anyone suggest how to do this without losing the data ?

and I found some strange error message when i do the fdisk -l ?


Thanks,

Albert

Last edited by albertwt; 03-28-2011 at 06:27 AM.
 
Old 12-23-2010, 09:02 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,598

Rep: Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516
Extend /, no, because your swap is right up against your / and you are not using LVM. You could, however, add another partiton.

Looks like your swap partition is about 1.5GB? So you have unpartitioned space on the disk.

To add a new partition, use fdisk (or cfdisk or gparted) to create a new partition on the disk. You will likely need to reboot here. Then use mkfs to create a filesystem on the new block device - probably /dev/sda3 or /dev/sda6. Then add a line in /etc/fstab for it and mount it with mount.

The partition boundary message is a warning, not an error. It is not optimal but it is not harmful.
 
1 members found this post helpful.
Old 12-23-2010, 09:06 PM   #3
albertwt
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 1
Question

thanks for your reply mate,

so in this case for all general linux installation, resizing the / partition is not recommended ?

cmiiw.
 
Old 12-23-2010, 09:37 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,598

Rep: Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516
Not sure what you mean. Resizing / is possible in general, but not possible for you in this specific case.
 
1 members found this post helpful.
Old 12-23-2010, 09:38 PM   #5
albertwt
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 1
Question

Quote:
Originally Posted by AlucardZero View Post
Not sure what you mean. Resizing / is possible in general, but not possible for you in this specific case.
thanks for the reply, may I know why ?
 
Old 12-23-2010, 09:42 PM   #6
albertwt
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 1
what I've found from the internet is the command "resize2fs -p /dev/sda1", does it resize proportionally for all of my partition ?
 
Old 12-23-2010, 10:36 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,050

Rep: Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971
Perhaps you should (re-)read post #2. I don't know what you think that command will do, but "man resize2fs" will tell you what the options are.
Best way to do this is a gparted liveCD - boot that in your VM. It's a GUI that will allow you to move the swap (and extended partition) out of the way so there is some contiguous free space after sda1. The you can resize it - gparted will do everything for you, so you won't need the resize2fs command at all.

BTW, don't edit your image(s) - if we can't read what's actually important, rather than what you think is important, we can't help you. Air your concerns, but leave the data intact.

Last edited by syg00; 12-23-2010 at 10:38 PM.
 
1 members found this post helpful.
Old 12-23-2010, 10:52 PM   #8
albertwt
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 1
Question

Quote:
Originally Posted by syg00 View Post
Perhaps you should (re-)read post #2. I don't know what you think that command will do, but "man resize2fs" will tell you what the options are.
Best way to do this is a gparted liveCD - boot that in your VM. It's a GUI that will allow you to move the swap (and extended partition) out of the way so there is some contiguous free space after sda1. The you can resize it - gparted will do everything for you, so you won't need the resize2fs command at all.

BTW, don't edit your image(s) - if we can't read what's actually important, rather than what you think is important, we can't help you. Air your concerns, but leave the data intact.
ah.. do you mean the screenshot or the disk image ?

Last edited by albertwt; 03-28-2011 at 06:27 AM.
 
Old 12-23-2010, 10:55 PM   #9
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,598

Rep: Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516
As I said - your swap is right up against your root partition, and you aren't using LVM, so you can't just extend /: something else is in the way!

I did not think of moving your swap partition, though, as syg00 says. So what you can do is boot a live CD, delete swap, expand /, remake swap, then resize2fs the / partition. And yeah gparted is probably the easiest way to do this.
 
1 members found this post helpful.
Old 12-24-2010, 01:22 AM   #10
sml156
LQ Newbie
 
Registered: Dec 2010
Posts: 6

Rep: Reputation: Disabled
Quote:
at the moment this Ubuntu Linux is deployed on top of VMware and I've just regrow the hard drive from 8 GB into 20 GB but can't see the effect immediately.
depending on how you setup vmware you might not see any change until you add files
 
  


Reply

Tags
fdisk, format, ubuntu


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
Finding capacity of Hard disk manoj.linux AIX 4 12-06-2010 11:51 PM
Extend Hard Disk size xav.vijay Linux - Newbie 3 11-05-2009 11:01 PM
extend the disk size in red hat 4 bigkat79 Linux - Newbie 1 05-18-2009 12:35 PM
Full Capacity of New Hard Drive Isn't Recognized. Why Not? km4hr Linux - Hardware 5 03-13-2009 09:13 AM
I can't access the full capacity of my hard disk urpion Linux - Newbie 5 10-20-2008 01:04 PM


All times are GMT -5. The time now is 03:03 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration