renovate partitions without reinstalling

thedogfarted thedogfarted at inbox.lv
Mon Mar 8 18:54:26 UTC 2004


When i moved from rh9 to fc1 and wanted to shrink windows partition i 
took a less 'funny' approach ???easier???

i booted from disk 1 in rescue mode, launched parted. I had already made 
my ntfs partiotion two times smaller with BootIt NG but as you want to 
get rid of your ntfs completely, there should be no problems with that :)

write '/dev/hda' (without quotes), that will select your ntfs disk

delete ntfs partition: 'rm 1'

the biggest problem is that you want to have your / and /boot partition 
on hda - we need to move them from one disk to other, but they could be 
ext3 partitions and parted doesn't support ext3 (although the manual 
says it does)

make desired partitions on hda. if you want ext3 partiotions, use mkpart 
command instead of mkpartfs, exit parted and use mkfs.ext3 command on 
that partition, that will format it as ext3

partitions are created, now the hardest part - copying

if they are ext2, you can use cp command within parted: 'cp /dev/hdc 1 
1' if hdc1 is /boot and it fits in hda1

in case of / and if you have ext3 partitions (as i do), you'll have to 
copy them manually (i suppose you want to keep /home on hdc)

exit form parted, mount both source and destination partitions, and use 
ordinary cp command to copy files from one partition to other (you can 
use mv instead of cp but i prefer cp - in case that smthing goes wrong 
data isn't lost)

now that you have copied all the files you wanted to reside on hda 
(probably all /boot partition and / without /home and /tmp) do what you 
want with hdc - probably move files that /home is instead of previous / 
etc and then edit grub.conf and fstab, it could look like this

grub.conf:

title Fedora Core 1 (kerneliic 2.4.22-1.2174.nptl)
	#this is if /boot is hda1
         root (hd0,0)
         kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi 
rhgb
         initrd /initrd-2.4.22-1.2174.nptl.img

fstab:
#hda
/dev/hda1	/boot	....
/dev/hda2	/	....
/dev/hda3	swap	....

#and add hdc partitions too

well, it should work, at least it worked for me :)

dballester at kernpharma.com wrote:
> Hi:
> 
>       Well, well, well... welcome to the freedoom club ;)
> 
> Supousing that you will delete your windows partitions, here is what i
> could do:
> 
> (In general, if you think that's good, let me know to explain in detail)
> 
>       Backup your important data from windows to linux ( docs,
> spreadsheets, music, images, etc...).
> 
>       Delete partitions in /dev/hda ( windows disk )
> 
>       Swap disks physicaly ( windows disk ( 20Gb ) will be at /dev/hdc and
> linux disk will be at /dev/hda )
> 
>       Boot machine with Fedora Disk1, in rescue mode.
> 
>       When prompted to mount your system under /mnt/sysimage respond yes.
> Then execute 'chroot /mnt/sysimage'. ( I don't remember if it's sysimage or
> another name...)
> 
>       Edit /etc/fstab. References to /dev/hdc must point now to /dev/hda.
> 
>       Edit /boot/grub/grub.conf. Delete lines corresponding to windows.
> References to hd2 will point now to hd0
> 
>       Save file.
> 
>       Execute grub-install
> 
>       Exit from chroot.
> 
>       Reboot.
> 
>       You have your fedora working from /dev/hda.
> 
>       Now, the funny steps :
>       =======================
> 
>       Shutdown -r now
> 
>       Startup with single mode
> 
>       We will use logical volumes, with them, we will expand our disks more
> easily in the future.
> 
>       Create partition for swap in /dev/hdc ( space can be  1 x RAM ),
> create 1 partition of ext3 type in /dev/hdc for /tmp partition and create 1
> LVM partition for /home. ( be sure to left 1-1,5 Gb free without
> partitioning )
> 
>       swap on /dev/hdc/<swap_partition>
> 
>       Configure LVM to make 1 physical volume, and assign all space in this
> partition for /home with ext3.
> 
>       mkdir /mnt/new_home
> 
>       Format /dev/hdc/<tmp_partition> with ext3.
> 
>       mount /dev/hdc/<lvm_home> /mnt/new_home
> 
>       cp -pRH /home/* /mnt/new_home
> 
>       mv /home /old_home
> 
>       Edit /etc/fstab to change values according to new configuration.
> 
>       Reboot.
> 
>       ( If your original / is not full, and is data can be moved to
> /dev/hdc for a while, i would be nice to make / again under LVM, too ).
> 
> HTH
> 
> Regards
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> David Ballester Montolio
> Responsable de Sistemas y Comunicaciones
> Kern Pharma, S.L.
> www.kernpharma.com
> 
> GNU!
> 
> 
> |---------+------------------------------>
> |         |           Charles Howse      |
> |         |           <chowse at charter.net|
> |         |           >                  |
> |         |           Enviado por:       |
> |         |           fedora-list-admin at r|
> |         |           edhat.com          |
> |         |                              |
> |         |                              |
> |         |           08/03/2004 17:40   |
> |         |           Por favor, responda|
> |         |           a fedora-list      |
> |         |                              |
> |---------+------------------------------>
>   >-----------------------------------------------------------------------------------------------------------------------------|
>   |                                                                                                                             |
>   |     Para:     fedora-list at redhat.com                                                                                        |
>   |     cc:                                                                                                                     |
>   |     Asunto:   renovate partitions without reinstalling                                                                      |
>   >-----------------------------------------------------------------------------------------------------------------------------|
> 
> 
> 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> I'm currently dual-booting winXP Pro and FC1, and the time has come to free
> 
> myself from Microsoft!  (long pause while cheers and applause subside)
> 
> I have a really, really, really great install of FC1 working now, and
> prefer
> not to do a complete reinstall.
> 
> I've googled a bit and looked around on the LDP for a HOWTO, but haven't
> found
> anything acceptable.
> 
> My current setup:
> [root at moe root]# fdisk -l
> 
> Disk /dev/hdc: 40.0 GB, 40020664320 bytes
> 16 heads, 63 sectors/track, 77545 cylinders
> Units = cylinders of 1008 * 512 = 516096 bytes
> 
>    Device Boot    Start       End    Blocks   Id  System
> /dev/hdc1   *         1       203    102280+  83  Linux
> /dev/hdc2           204     75465  37932048   83  Linux
> /dev/hdc3         75466     77545   1048320   82  Linux swap
> 
> Disk /dev/hda: 20.5 GB, 20525137920 bytes
> 16 heads, 63 sectors/track, 39770 cylinders
> Units = cylinders of 1008 * 512 = 516096 bytes
> 
>    Device Boot    Start       End    Blocks   Id  System
> /dev/hda1   *         1     39749  20033023+   7  HPFS/NTFS
> 
> Grub is installed in the MBR of /dev/hda.
> 
> I would like to have the following new setup:
> /boot, /, swap on /dev/hda
> /home, /tmp, swap on /dev/hdc
> Grub in the MBR of /dev/hda
> 
> I have a good backup, and don't mind reinstalling if there's no other
> option,
> but I was wondering if anyone could give me a nudge in the right direction?
> 
> - --
> Charles Howse
> Jackson, TN
> Registered Linux user # 347576 (http://counter.li.org)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQFATKIc/S+VsB9RMKgRAlshAJ4nnX9+3nR2PrlPX4qIJAR9IOIJEwCfeQUz
> sGEyXs2ThR1iKI3sXxRwp2k=
> =uLuM
> -----END PGP SIGNATURE-----
> 
> 
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
> 
> 
> 
> 
> 
> 





More information about the fedora-list mailing list