reduce partitions

Kherzi Samir skherzi at axway.com
Wed Dec 30 09:10:51 CST 2009


Glad to see that it worked fine :)

Regards,
Samir KHERZI


Le 30 déc. 2009 à 16:01, "Johannes Huisman"  
<johannes.huisman at gmail.com> a écrit :

> I thought it may be useful for further reference
> to send an account of what I finally did in order
> to shrink the logical root volume.
>
> I'm left wondering why Dell chose to partition the
> hard disk as they did. Maybe I'm missing something
> here?
>
> Kherzi Samir wrote:
>> 1. boot from a live CD (My favorite is SysRescueCD, 241 MiB)
>
> Since I did not have a CD at hand to burn a SysRescueCD,
> I took the RHEL installation CD and typed "linux rescue"
> at the boot: prompt as explained in the RHEL installation
> guide, and skipped mounting any file systems.
>
>> 2. be sure all volume are not mounted. If they are mounted, unmount  
>> them
>>
>> 3. import the volume group into the system
>> $> vgimport -a
>
> I had to prefix all LVM commands with "lvm",
> but "lvm vgimport -a" resulted in a remark that
> no volume groups were exported.
>
>> 4. activate the volume group
>> $> vgchange -a y VolGroup00
>>
>> 5. make a check of the filesystem
>> $> e2fsck -f /dev/VolGroup00/LogVol00
>>
>> 6. reduce the filesystem of the logical volume to 15 GB
>> $> resizefs /dev/VolGroup00/LogVol00 15GB
>
> On RHEL the command is resize2fs and the parameter
> should be 15G or <any large enough natural number>G,
> for that matter.
>
>> 7. reduces the logical volume
>> $> lvreduce -L 15G /dev/VolGroup00/LogVol00
>>
>> 8. boot from your normal system. You should have 15 GB for your /  
>> filesystem.
>
> Everything worked out OK. Thanks again to everybody,
> and to Samir especially!
>
> As has been suggested by J. Epperson, I added sda5
> as a physical volume to VolumeGroup00, by following
> the RHEL deployment guide, and now have a logical
> volume of 100G for the root directory, and another
> logical volume of 100G for the home directory,
> and the rest of the volume group is unused and available
> for future use (apart from a small logical swap volume).
>
> Johannes
>
>> If you want to create a volume for your home, then do the following:
>> 1. create a new logical volume for your home (let's say the  
>> complete size of what is free)
>> $> lvcreate -l 100%FREE -n LogVol01 VolGroup00
>>
>> 2. create the filesystem
>> $> mkfs.ext3 /dev/VolGroup00/LogVol01
>>
>> 3. mount the new filesystem
>> $> mkdir /new_home
>> $> mount /dev/VolGroup00/LogVol01 /new_home
>>
>> 4. copy everything from your existing home
>> $> cp -p -r /home/* /new_home
>>
>> 5. unmount the home and mount the new home
>> $> umount /home
>> $> umount /new_home
>> $> mount /dev/VolGroup00/LogVol01 /new_home
>>
>> That's it!
>>
>> Hope it helped.
>>
>> Best Regards,
>> Samir KHERZI
>>
>>
>>
>>
>> -----Original Message-----
>> From: linux-desktops-bounces at dell.com on behalf of Johannes Huisman
>> Sent: Wed 12/30/2009 06:22
>> To: linux-desktops at dell.com
>> Subject: reduce partitions
>>
>> Hello,
>>
>> I've received a Dell Precision M2400 with RHEL Desktop 5.3 installed:
>>
>> [root at localhost ~]# uname -a
>> Linux localhost.localdomain 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9  
>> 03:27:37 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
>>
>> I'm bothered about the partition table that has been set up by Dell:
>>
>> [root at localhost ~]# fdisk -l
>>
>> Disque /dev/sda: 320.0 Go, 320072933376 octets
>> 255 heads, 63 sectors/track, 38913 cylinders
>> Unités = cylindres de 16065 * 512 = 8225280 octets
>>
>> Périphérique Amorce    Début         Fin      Blocs    Id  Syst 
>> ème
>> /dev/sda1               1          30      240943+  de  Dell Utility
>> /dev/sda2              31         814     6297480    c  W95 FAT32  
>> (LBA)
>> /dev/sda3   *         815         839      200812+  83  Linux
>> /dev/sda4             840       38913   305829405    5  Extended
>> /dev/sda5             840        1361     4192933+  83  Linux
>> /dev/sda6            1362       38913   301636408+  8e  Linux LVM
>>
>> [root at localhost ~]# df  -h
>> Sys. de fich.         Tail. Occ. Disp. %Occ. Monté sur
>> /dev/mapper/VolGroup00-LogVol00
>>                      274G  5,1G  254G   2% /
>> /dev/sda5             3,9G  122M  3,6G   4% /home
>> /dev/sda3             190M   25M  156M  14% /boot
>> tmpfs                 1,9G     0  1,9G   0% /dev/shm
>>
>> So, I only have 3.9 GB for /home and have 274 GB for / at my  
>> disposal!
>> I naturally would like to reduce disk space for / and increase disk
>> space for /home. How should I do this in a secure way? Can
>> anybody help me? Thanks a lot in advance!
>>
>> Johannes Huisman
>>
>> _______________________________________________
>> Linux-Desktops mailing list
>> Linux-Desktops at dell.com
>> https://lists.us.dell.com/mailman/listinfo/linux-desktops
>> Please read the FAQ at http://lists.us.dell.com/faq
>>
>>
>>
>>
>> --- 
>> ---------------------------------------------------------------------
>>
>> _______________________________________________
>> Linux-Desktops mailing list
>> Linux-Desktops at dell.com
>> https://lists.us.dell.com/mailman/listinfo/linux-desktops
>> Please read the FAQ at http://lists.us.dell.com/faq
>
> _______________________________________________
> Linux-Desktops mailing list
> Linux-Desktops at dell.com
> https://lists.us.dell.com/mailman/listinfo/linux-desktops
> Please read the FAQ at http://lists.us.dell.com/faq



More information about the Linux-Desktops mailing list