PDA

View Full Version : Enlarge partition at the end of the disk



YagoLima
10th June 2011, 09:06 PM
Whell, I've installed fedora on my PC by reducing the existing NTFS partition and installing Fedora on free space at the end of the disk.
Now I'd like tho enlarge fedora's partition.
How can I do this?
If I just move the partition back in disk, can I boot normally on fedora?
Thanks

Mariusz W
10th June 2011, 10:36 PM
Whell, I've installed fedora on my PC by reducing the existing NTFS partition and installing Fedora on free space at the end of the disk.
Now I'd like tho enlarge fedora's partition.
How can I do this?
If I just move the partition back in disk, can I boot normally on fedora?
Thanks

It is not clear what you are trying to do. Are you going to further shrink the NTFS partition? How are you going to "move back" the Fedora partition? (is there only one Fedora partition? there should be at least two, more likely three, or even for -- if you keep /boot and /home on separate partitions).

YagoLima
11th June 2011, 10:23 PM
I'm sorry. My english is not pretty good.
Whell
I my fedora's partitions are inside a logical one.
I'm new to Red Hat Linux, I've been using Debian for some time.
All I now about the partitions is what I can see in GParted.
There is a 524MB ext4 partition and a Linux LVM one of 22GB.
I used the default instalation by selecting "Install on entire free space" in the bootable disk.
Before that I've reduced the ntfs partition.
So I need to extend Linux disk space but it is installed at the end of the disk.
How can I do this?

stoat
11th June 2011, 10:36 PM
Here's what you should do... Post something that shows the partition layout. Maybe a screenshot of gparted or the output of fdisk -l. I think that will help your readers to understand the situation better and the possibilities to change it.

pocketdrummer
12th June 2011, 01:59 AM
I think I'm running into the same problem.

My windows partition is at the beginning of the drive, then the boot partition, then Fedora's partition. I can shrink the windows partition, but if you try to move the /boot partition, it says the computer may not boot properly.

Is there a way to move the /boot partition so that it doesn't brick the system?

---------- Post added at 07:59 PM ---------- Previous post was at 04:37 PM ----------

Anyone? I'm workin' with 54MB of storage here... you read that right... megabytes...

YagoLima
12th June 2011, 07:59 PM
Here's what you should do... Post something that shows the partition layout. Maybe a screenshot of gparted or the output of fdisk -l. I think that will help your readers to understand the situation better and the possibilities to change it.
Here it is:


#fdisk -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = setores of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x68000000

Dispositivo Boot Start End Blocks Id System
/dev/sda1 63 321299 160618+ de Utilitário Dell
/dev/sda2 * 327680 25804799 12738560 7 HPFS ou NTFS
/dev/sda3 25804800 933027839 453611520 7 HPFS ou NTFS
/dev/sda4 933027840 976773119 21872640 5 Estendida
/dev/sda5 933029888 934053887 512000 83 Linux
/dev/sda6 934055936 976773119 21358592 8e Linux LVM

Hope it helps

stoat
12th June 2011, 09:40 PM
Hope it helps It does.


Before that I've reduced the ntfs partition.
So I need to extend Linux disk space but it is installed at the end of the disk.
How can I do this? It's not going to be easy, but it's conceivable to shrink that NTFS partition again (it's plenty big), then move the "front end" of the extended partition over into the newly created space, and then "slide" the Fedora boot partition "forward" to be at the "front" of the extended partition again. That much you can do with a GParted Live CD. But the next part, enlarging the LVM PV, will require you first to enlarge the partition, then enlarge the PV inside the partition, then enlarge the LVs inside the PV, then enlarge the filesystems inside the LVs. For that stuff, you will need to teach yourself how to use the various LVM utilities for those jobs. Plan on having to re-install the GRUB boot loader, too. IMO, unless that system has extraordinary value for some reason, I would start over. And this time, get the partition layout right from the beginning.

Maybe somebody else has a better idea. Maybe after you enlarge the extended partition, you could stop at that point, create a new logical partition and PV and LV, then add that to the LVM system. That's one of the advantages of using LVM, I guess. I just never cared enough to learn how to do that. There are plenty of LVM advocates and experts around here to help with that stuff.

P.S.: There is 3.2 GB of wasted space between /dev/sda1 and /dev/sda2. There's nothing much you can do with it or about it. Just FYI.

jvillain
13th June 2011, 01:17 AM
I went through this recently. If you are using UUID's to identify your partitions then moving them won't mess up your boot process. I ran GParted from inside of my running Linux partition and was able to shrink my windows partition as well as move my boot and / partitions. I then use system-config-lvm to grow my logical partition. I used btrfsctl to resize the file system. It's safer to use a disk to boot off of but not necessary.

pocketdrummer
13th June 2011, 06:57 AM
I went through this recently. If you are using UUID's to identify your partitions then moving them won't mess up your boot process. I ran GParted from inside of my running Linux partition and was able to shrink my windows partition as well as move my boot and / partitions. I then use system-config-lvm to grow my logical partition. I used btrfsctl to resize the file system. It's safer to use a disk to boot off of but not necessary.

Can you provide a step by step for us greenhorns? I didn't realize I would go through the space on this partition so fast :_(

YagoLima
13th June 2011, 07:21 PM
Whell, woudn't it be easier if I backup the system and them reinstall it with a larger space?
If yes, how can I do this?
Thanks

jvillain
13th June 2011, 07:35 PM
It might be. Depends on if there is any thing you will need to restore or not. If not then fire up gedit and use it to shrink your windows partition. Then reinstall and when the installer asks you if you want to wipe the whole drive or just the linux partitions tell it just the linux partitions.

YagoLima
14th June 2011, 02:50 PM
It might be. Depends on if there is any thing you will need to restore or not. If not then fire up gedit and use it to shrink your windows partition. Then reinstall and when the installer asks you if you want to wipe the whole drive or just the linux partitions tell it just the linux partitions.

Well, I can use gparted to do it, but I'd like to keep my system as it where before, with programs and configurations I've made. How can I do this?

jvillain
14th June 2011, 08:36 PM
Fire up gparted so it displays your partition information and then do a screen cap and post it so we can see what is going on exactly.

The first step should be to use gparted to shrink your windows partition. You will probably have to boot into windows first to see how much space you have to do that with.

After that move the boot partition over to fill in the space.

After that it is probably grow your root partition time but we need to see the partition layout first to say for sure.

YagoLima
14th June 2011, 11:40 PM
Well, I searched the web for a way to backup my system and I found this:


tar -cpvf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/media --exclude=/sys --exclude=/srv /


I executed the command from the OS partition in my system, which is NTFS and has 300GB of free space.
But i've got this error message:


...
/sbin/auditctl
/sbin/arping
/sbin/route
/sbin/iptables
tar: Exiting with failure status due to previous errors


What does it means?
How can I fix?
Thanks

jvillain
15th June 2011, 06:26 PM
There was a error some where that isn't shown did you run out of space? You aren't compressing your archive even though you gave it the tgz extension. Delete the archive you did create and try adding a j to your switches and call the archive file backup.tar.bz2

Are you running this as root? You will need to to get every thing.

YagoLima
16th June 2011, 04:18 AM
There was a error some where that isn't shown did you run out of space? You aren't compressing your archive even though you gave it the tgz extension. Delete the archive you did create and try adding a j to your switches and call the archive file backup.tar.bz2

Are you running this as root? You will need to to get every thing.
Well, there are 300GB of free space in that partition. So, There's space enough for the file.
whell, actually I was compressing it, I just forgot puting the 'z' parameter.
Yes, I'm running as root.
Well, bzip2 would take too much time to compress so much data.
I'm using gzip.

I tryed again and I'm still having the same error at the same file.

YagoLima
22nd June 2011, 08:19 PM
Whell, I tried using the command


# tar -cpvzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/media --exclude=/sys --exclude=/srv --exclude=/sbin /


but I've got


/boot/System.map-2.6.35.6-45.fc14.x86_64
/boot/vmlinuz-2.6.35.13-91.fc14.x86_64
/boot/initramfs-2.6.35.13-91.fc14.x86_64.img
/boot/initramfs-2.6.35.13-92.fc14.x86_64.img
tar: Exiting with failure status due to previous errors

I noticed that in both cases tar exited when the file reached 7GB
But the partition has 300GB of free space.
Is there a limit for the file size
Does it matter if I'm saving the tgz file in a NTFS partition?

---------- Post added at 04:19 PM ---------- Previous post was at 03:23 PM ----------

I tried


tar -cpvML 6815744 -f backup.tar --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/media --exclude=/sys --exclude=/srv /


but i got the same prblem:


/sbin/auditctl
/sbin/arping
/sbin/route
/sbin/iptables
tar: Exiting with failure status due to previous errors

It seems that there is some problem with the file /sbin/iptables or with the next file to compress.

Whell, what can I do?

stoat
24th June 2011, 02:43 AM
Of course continue doing whatever you want to do, but I think you are wasting your time and courting a disaster. First, after reading what you've been doing so far, I wouldn't trust any backup that you managed to complete. And second, you're not taking advantage of LVM's touted flexibility for filesystem manipulation and expansion.

Consider creating a new physical volume and extending your existing logical volume and its filesystem into it. Now, I've not done it myself because I don't use LVM. And I don't use LVM because of what's going on right here. But I've read a lot about it and know this kind of thing can be done. It's what LVM is for really. But you are using LVM for whatever reason, so this is what I would investigate and teach myself how to do. There are guides and tutorials all over the place. After that, the actual work would be over in 90 seconds. Use gparted to shrink the NTFS partition again to create some space.
Use gparted to enlarge the extended partition into the newly created space.
Use gparted to create a new logical partition in the extended partition.
Use fdisk to change the new logical partition to type 8e.
Use pvcreate to create a new physical volume in the new partition.
Use vgextend to add the new physical volume to your existing volume group.
Use lvextend to enlarge the existing logical volume that you want expand.
Use resize2fs to enlarge the filesystem of the logical volume.
If you create the new partition "in front of" the Fedora boot partition, then you will have to edit grub.conf.What else good is LVM doing you if you don't use it like that? Otherwise it's just a giant unnecessary complication that is enflaming your maintenance problems. If you had installed Fedora in ordinary ext3 or ext4 partitions, you could have been done with this project in a few minutes using gparted to do everything.

P.S.: Anyone who uses LVM and has the knowledge should feel free to help this person, confirm or correct what I suggested, or post a better idea to enlarge the LVM-based Fedora system.