View previous topic :: View next topic |
Author |
Message |
Nebetsu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/2325623894617cbe79f92c.png)
Joined: 20 Feb 2006 Posts: 229 Location: Canada
|
Posted: Fri Sep 29, 2006 4:21 am Post subject: I want to stretch my partition. [SOLVED] |
|
|
I tried using qtparted but it doesn't want to resize it. I have it like this:
hda1: linux (ext3): ~18GB
hda2: free space: ~18GB
hda3: linux swap: ~1GB
What I want to do is stretch hda1 so it fills up the free space. Does anyone know how I can go about doing this?
Last edited by Nebetsu on Wed Oct 11, 2006 12:57 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yabbadabbadont Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/13361939844cd4b5d53ebe4.jpg)
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Fri Sep 29, 2006 4:25 am Post subject: |
|
|
I believe that you have to delete the partition containing the free space (hda2) so that the partitioner will see that it is truly free. Then you should be able to resize hda1.
Edit: You should be able to do all of this from qtparted. _________________
Bones McCracker wrote: | On the other hand, regex is popular with the ladies. |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Nebetsu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/2325623894617cbe79f92c.png)
Joined: 20 Feb 2006 Posts: 229 Location: Canada
|
Posted: Fri Sep 29, 2006 7:45 am Post subject: |
|
|
I can't delete it. It's just free space in between hda1 and hda3 I guess. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
drwook Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 30 Mar 2005 Posts: 1324 Location: London
|
Posted: Fri Sep 29, 2006 8:43 am Post subject: |
|
|
Well I've done exactly this a good number of times using qtparted... Are you sure there's no partition there where you think there's free space? Have you tried right clicking and seeing if there's a delete option? If so, there's a partition there
Personally I'd always advise a backup before doing this... Never had a problem myself but... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
x22 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 24 Apr 2006 Posts: 208
|
Posted: Fri Sep 29, 2006 8:57 am Post subject: |
|
|
All partitions on hda have to be unmounted to do this.
If qtparted does not work, you may use gparted or parted or fdisk + hdparm (for reloading partition table) + resize2fs. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
drwook Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 30 Mar 2005 Posts: 1324 Location: London
|
Posted: Fri Sep 29, 2006 9:02 am Post subject: |
|
|
x22 wrote: | All partitions on hda have to be unmounted to do this.
If qtparted does not work, you may use gparted or parted or fdisk + hdparm (for reloading partition table) + resize2fs. |
Interestingly I'm fairly certain I've done this inside a running system a couple of times without unmounting Although generally I use a knoppix CD so I don't have to care what's on the system already...
gparted's nice too, but essentially does the same thing. If gparted works and qtparted doesn't, I'd think about opening a bug (probably upstream)... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Sachankara l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/20654153364410b1c04b571.png)
Joined: 11 Jun 2004 Posts: 696 Location: Stockholm, Sweden
|
Posted: Fri Sep 29, 2006 11:52 am Post subject: |
|
|
A tip: Buy a new harddisk, create a Device Mapper volume group on it, create a couple of partitions (logical volumes) on it in ReiserFS or XFS and then transfer all your data from the old drive to the new one. With LVM you'll be able to resize partitions on live file systems, while you're using them and they are mounted. LVM also have other cool stuff like mirroring, snapshots, bad block relocation, etc. It's actually quite simple to use.
For example: If I want to add 1 GiB to my home partition, all I have to do is this: Code: | $ lvextend -L+1G /dev/volumegroup/home
$ xfs_growfs /home |
_________________ Gentoo Hardened Linux 2.6.21 + svorak (Swedish dvorak) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
syg00 l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 23 Aug 2004 Posts: 907 Location: Brisbane, AUS
|
Posted: Fri Sep 29, 2006 12:05 pm Post subject: |
|
|
Let's see some real information - output from "fdisk -l". _________________ Got a good backup ??? - any advice offered presumes you have. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
padoor Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/The Jetsons/cartoon_the_jetsons_spacely.gif)
Joined: 30 Dec 2005 Posts: 4185 Location: india
|
Posted: Fri Sep 29, 2006 12:40 pm Post subject: |
|
|
if u delete the hda3 it might see the free space.
cfdisk also may be useful to get some more info about the hdd. _________________ reach out a little bit more to catch it (DON'T BELIEVE the advocate part under my user name) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Nebetsu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/2325623894617cbe79f92c.png)
Joined: 20 Feb 2006 Posts: 229 Location: Canada
|
Posted: Fri Sep 29, 2006 9:03 pm Post subject: |
|
|
syg00 wrote: | Let's see some real information - output from "fdisk -l". |
Code: | yajuu nebetsu # fdisk -l
Disk /dev/hda: 40.0 GB, 40037760000 bytes
255 heads, 63 sectors/track, 4867 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 2350 18876343+ 83 Linux
/dev/hda3 4701 4867 1341427+ 82 Linux swap / Solaris |
I cut off the part about my other hard drives because I don't think that matters.
And I've tried to right click and delete the partition. That's the first thing I did. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yabbadabbadont Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/13361939844cd4b5d53ebe4.jpg)
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Fri Sep 29, 2006 9:18 pm Post subject: |
|
|
You will have to be booted from a live cd in order to resize a partition on the drive. Or at least be booted using a harddrive other than the one containing the partition you wish to change. Basically, the drive can't be in use at all when you do it. _________________
Bones McCracker wrote: | On the other hand, regex is popular with the ladies. |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
syg00 l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 23 Aug 2004 Posts: 907 Location: Brisbane, AUS
|
Posted: Fri Sep 29, 2006 10:54 pm Post subject: |
|
|
I generally also recommend Knoppix for all "recovery" type work, but in this case the gparted livecd would probably be the go.
There is nothing I can see in the fdisk list to indicate why the resizing shouldn't work.
Personally I generally do these things by hand rather than use a GUI.
However, last time I tried to resize an ext2(3), I could never get it to complete successfully. Others have had better luck.
Now I just don't bother - I delete the partitions(s) involved, create new, make the filesystem of choice and restore. May take a little longer, but you know what happened at each stage. And it's not done that often in a normal environment.
The suggestion to use LVM is also something to think about. If I didn't screw with my systems so much I would use it without question. _________________ Got a good backup ??? - any advice offered presumes you have. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Nebetsu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/2325623894617cbe79f92c.png)
Joined: 20 Feb 2006 Posts: 229 Location: Canada
|
Posted: Mon Oct 09, 2006 1:29 am Post subject: |
|
|
It's not mounted. It's not being used. I'm using QTParted. It's not resizing... >> |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
padoor Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/The Jetsons/cartoon_the_jetsons_spacely.gif)
Joined: 30 Dec 2005 Posts: 4185 Location: india
|
Posted: Mon Oct 09, 2006 3:01 am Post subject: |
|
|
Device Boot Start End Blocks Id System
/dev/hda1 1 2350 18876343+ 83 Linux
/dev/hda3 4701 4867 1341427+ 82 Linux swap / Solaris
the cylinder numbers are not continuous .there is a gap from 2351 to 4700
u can afford to delete the swap for temporary and make the continuous space available
than only it can see the freespace to resize .after resizing u can make swap again. _________________ reach out a little bit more to catch it (DON'T BELIEVE the advocate part under my user name) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
devsk Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_minsc.gif)
Joined: 24 Oct 2003 Posts: 3003 Location: Bay Area, CA
|
Posted: Mon Oct 09, 2006 4:20 am Post subject: |
|
|
Nebetsu wrote: | syg00 wrote: | Let's see some real information - output from "fdisk -l". |
Code: | yajuu nebetsu # fdisk -l
Disk /dev/hda: 40.0 GB, 40037760000 bytes
255 heads, 63 sectors/track, 4867 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 2350 18876343+ 83 Linux
/dev/hda3 4701 4867 1341427+ 82 Linux swap / Solaris |
| you don't require to boot into any livecd or use any specialized tools to handle this particular case. boot into this system. login as root. swapoff the swap. Use fdisk and delete hda3. delete hda1. recreate hda1 with 'n' and 'p' with start 1 and end 4700. recreate hda2 with 'n' and 'p' with the rest of cylinders. change its type to 82 with 't'. write the table with 'w'. reboot. 2.6 kernels allow online resizing. Once booted, login as root and use resize2fs to resize /dev/hda1 to new size. change fstab to point swap at hda2.
Remember to make full backup on another disk or host before trying this. Do not attempt if you are scared of fdisk and don't know what it does. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Nebetsu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/2325623894617cbe79f92c.png)
Joined: 20 Feb 2006 Posts: 229 Location: Canada
|
Posted: Mon Oct 09, 2006 6:37 am Post subject: |
|
|
Would I have to use Norton Ghost or would I be able to do a standard copy? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
devsk Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_minsc.gif)
Joined: 24 Oct 2003 Posts: 3003 Location: Bay Area, CA
|
Posted: Mon Oct 09, 2006 7:50 am Post subject: |
|
|
Nebetsu wrote: | Would I have to use Norton Ghost or would I be able to do a standard copy? | you mean for the backup? use whatever you normally feel comfortable with i.e. something which you have used before and you know works for you. if ghost it is, use ghost. I typically use dar for backups because it allows to do incremental backups. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
padoor Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/The Jetsons/cartoon_the_jetsons_spacely.gif)
Joined: 30 Dec 2005 Posts: 4185 Location: india
|
Posted: Mon Oct 09, 2006 9:50 am Post subject: |
|
|
i would say the backup is not necessary if the parted is used carefully.
u can boot from the cd and run parted.
delete the hda3 and extend the hda to higher cylinder numbers and save.
make hda2 swap and save change the drive letter in fstab also.
it should not kill the existing data or installation.
if u are not sure how to do then better back it up and do afresh partition.
think of how u restore the backed up installation after making new partitions. _________________ reach out a little bit more to catch it (DON'T BELIEVE the advocate part under my user name) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
devsk Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_minsc.gif)
Joined: 24 Oct 2003 Posts: 3003 Location: Bay Area, CA
|
Posted: Mon Oct 09, 2006 10:52 am Post subject: |
|
|
padoor wrote: | i would say the backup is not necessary if the parted is used carefully. | backup is always necessary.... ![Wink :wink:](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
drwook Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 30 Mar 2005 Posts: 1324 Location: London
|
Posted: Mon Oct 09, 2006 11:52 am Post subject: |
|
|
devsk wrote: | padoor wrote: | i would say the backup is not necessary if the parted is used carefully. | backup is always necessary.... ![Wink :wink:](images/smiles/icon_wink.gif) |
Well, they only have to be necessary once for them to be worthwhile... ![Wink ;)](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Gentree Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/1364161114417d616b9645b.jpg)
Joined: 01 Jul 2003 Posts: 5350 Location: France, Old Europe
|
Posted: Mon Oct 09, 2006 12:13 pm Post subject: |
|
|
Nebetsu wrote: | It's not mounted. It's not being used. I'm using QTParted. It's not resizing... >> |
qtparted is a program not on OS. I suggest you clarify what you think you are doing before proceeding.
It may help others if you clarify here once you've worked it out.
You have ample info here on what to do but thread carefully, you have one foot firmly in the abyss. ![Cool 8)](images/smiles/icon_cool.gif) _________________ Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Nebetsu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/2325623894617cbe79f92c.png)
Joined: 20 Feb 2006 Posts: 229 Location: Canada
|
Posted: Mon Oct 09, 2006 8:04 pm Post subject: |
|
|
Gentree wrote: | Nebetsu wrote: | It's not mounted. It's not being used. I'm using QTParted. It's not resizing... >> |
qtparted is a program not on OS. I suggest you clarify what you think you are doing before proceeding.
It may help others if you clarify here once you've worked it out.
You have ample info here on what to do but thread carefully, you have one foot firmly in the abyss. ![Cool 8)](images/smiles/icon_cool.gif) |
I used the Knoppix live cd and made sure that none of my drives were mounted. Then I opened QTParted by clicking on it in the K menu. Then I tried to resize it, but the resize option in the menu and the one that appears when you right click the partition has been greyed out and does not work. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yabbadabbadont Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/13361939844cd4b5d53ebe4.jpg)
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Mon Oct 09, 2006 8:52 pm Post subject: |
|
|
If you have a swap partition on any of your drives, knoppix will use it by default unless you specify "noswap" as an option when you boot the cd. If you didn't do that you can, from a terminal, issue "swapoff -a" to disable swap. You can use the "free" command in a terminal to see if swap is currently active. _________________
Bones McCracker wrote: | On the other hand, regex is popular with the ladies. |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Nebetsu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/2325623894617cbe79f92c.png)
Joined: 20 Feb 2006 Posts: 229 Location: Canada
|
Posted: Mon Oct 09, 2006 9:39 pm Post subject: |
|
|
yabbadabbadont wrote: | If you have a swap partition on any of your drives, knoppix will use it by default unless you specify "noswap" as an option when you boot the cd. If you didn't do that you can, from a terminal, issue "swapoff -a" to disable swap. You can use the "free" command in a terminal to see if swap is currently active. |
Disabled swap in Knoppix and it still won't resize. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yabbadabbadont Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/13361939844cd4b5d53ebe4.jpg)
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Mon Oct 09, 2006 10:18 pm Post subject: |
|
|
Nebetsu wrote: | yabbadabbadont wrote: | If you have a swap partition on any of your drives, knoppix will use it by default unless you specify "noswap" as an option when you boot the cd. If you didn't do that you can, from a terminal, issue "swapoff -a" to disable swap. You can use the "free" command in a terminal to see if swap is currently active. |
Disabled swap in Knoppix and it still won't resize. |
Sounds like it is time to do a full backup and repartition the disc... _________________
Bones McCracker wrote: | On the other hand, regex is popular with the ladies. |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|