LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to extend the Ubuntu Linux hard disk size to use full capacity ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-extend-the-ubuntu-linux-hard-disk-size-to-use-full-capacity-852130/)

albertwt 12-23-2010 09:54 PM

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

AlucardZero 12-23-2010 10:02 PM

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.

albertwt 12-23-2010 10:06 PM

thanks for your reply mate,

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

cmiiw.

AlucardZero 12-23-2010 10:37 PM

Not sure what you mean. Resizing / is possible in general, but not possible for you in this specific case.

albertwt 12-23-2010 10:38 PM

Quote:

Originally Posted by AlucardZero (Post 4201680)
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 ?

albertwt 12-23-2010 10:42 PM

what I've found from the internet is the command "resize2fs -p /dev/sda1", does it resize proportionally for all of my partition ?

syg00 12-23-2010 11:36 PM

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.

albertwt 12-23-2010 11:52 PM

Quote:

Originally Posted by syg00 (Post 4201707)
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 ?

AlucardZero 12-23-2010 11:55 PM

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.

sml156 12-24-2010 02:22 AM

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


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