Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GNU parted: Too scared to repartition running system...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Fri Feb 21, 2003 9:06 am    Post subject: GNU parted: Too scared to repartition running system... Reply with quote

I don't know how you feel, but parted sends shivers down my spine. Moving chunks of data around the disk like there's no tomorrow, filesystem and all, is something I've never understood, and my anxiety grows when I think about what I have to do to make space for yet another Gentoo installation, my seventh or so, on increasingly fishy hardware...

Here's the plan. I have a 30 GB disk that's partitioned like this, courtesy of an existing Mandrake installation:
Code:
   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1      7111   3583912+  83  Linux
/dev/hda2          7112     58140  25718616    5  Extended
/dev/hda5          7112      7618    255496+  82  Linux swap
/dev/hda6          7619     58140  25718616   83  Linux

NB: That's 3.5 GB for / on /dev/hda1 and 26 for /home on /dev/hda6... Don't ask about the mount points, it's a mess. Now, what I want it to look like is something along these lines:
  • /dev/hda1 reduced to 50 MB or so, mountpoint /boot (Gentoo)
  • /dev/hda2 recreated as an empty 4 GB primary partition (intended BeOS install)
  • /dev/hda3 8 GB (will eventually become a FreeBSD slice)
  • /dev/hda4 Extended goes here
  • /dev/hda5 swap at a few hundred MB, shared between Gentoo and MDK
  • /dev/hda6 becomes / for MDK with at least 5 GB (the old /home gets moved in here, too)
  • /dev/hda7 has the honour to accomodate the Gentoo / with more than one third of the disk to itself
I'd be glad if anyone had comments on the layout (there may be a better way to do this) and especially on the procedure using parted! I'm aware of the alternative installation guide and the parted manual, in case you were wondering. Try waking me up in the middle of the night and I'm sure I'd be able to quote entire pages, but I'm frightfully lacking practice... 8O
Back to top
View user's profile Send private message
Wiebel
n00b
n00b


Joined: 05 Feb 2003
Posts: 60
Location: Bad Homburg, Germany

PostPosted: Sat Feb 22, 2003 5:07 am    Post subject: Reply with quote

OK partitioning is one of my favourites :roll:

First of all:

    It's really important do keep track of what you're doing so write everything down.



I had, compared to you, a really grim mess in my partition Table.
I was also afraid of yousing parted, so i did the long, but safe(r), run.
If I understood You right, there is only one Partition that shouldn't get damaged, so it won't be too hard.
You want your 25G home partition moved to your new 5G root so I assume it's not too full.
First you should delete all partitions you won't need. Be brave. 8)
Ahh and write it all down all starts and endings and everything as long as you won't run mkfs or dd all can be repaired (if your part.table is very special there are more detailed infos under the x command in fdisk, but you won't need it, at least I think so)
If more than 3.5G of your home is used, you have to resize hda6 with any tool, i haven't done that so far, but I think it's easy enough.
Then create some temporary primary partitions do do the swapping. If the size differs like with your /home you can e.g. build an 3.5G hda1, or to save time just the size needed for your actual home data then mkfs hda1 mount .. mkdir home .. cp ..
If you want to keep hda1 it's starting to get fishy, but after resizing hda6 you can create a primary partition after the others eg hda3.
You can delete hda2 and recreate ext under hda4 without loosing any data, so again be brave.
Basically you have to do the same as defragmenting manually and with bigger blocks.
I actually made a spreadsheet for assistance, in every case you have to make a roadmap of what you will do.

Use dd to copy whole partitions and cp -a like you know it.

You should think of the benefits of lvm or evms.

At last to cheer you my old and my new partition Table (both work):

Code:

Old:

             Start Size
hda4  hda5      2   10G   win D:       
      hda7   1277  180M   swap         
      hda6   1300    5G   /home
hda2         1902   10G   /
hda1         3179    4G   win C:
hda3         3726   80M   /boot         

New:

hda1            1    5G   win C:
hda2          548   95M   /boot
hda3          560  1.5G   /
hda4  hda5    750   12G   win D:
      hda6   2300    5G   uservg
      hda7   3000    5G   uservg
      hda8   3700  290M   swap


Be aware of old hda6 which was created as 2nd logical drive in ext. This action leaded to a 14 byte shift of the begining of the block, which is perfectly normal behavior when you do such mad things. So every other partitioning program tells you that your table is broken.

You see there is always hope.

P.S.: I hope you didn't fell asleep
Back to top
View user's profile Send private message
jgmcbride
n00b
n00b


Joined: 16 Feb 2003
Posts: 27
Location: New York NY

PostPosted: Sat Feb 22, 2003 11:02 pm    Post subject: Reply with quote

What about simply putting a second hd in the machine temporarily.Mount this drive and move your data to it. This should then free up your initial drive to reinstall.

Alternatively since you have a Win partition then try Partition Magic. I have used it manytimes before and it has never failed me.
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Sun Feb 23, 2003 5:55 am    Post subject: Reply with quote

I'm sorry, but neither do I have a Windows partition anywhere on this disk, nor space for a second disk, let alone any desire to rip this one out of its bay and put it somewhere else, for that matter. It's a notebook so crammed inside I'd have to completely take it apart to get to the disk. I did that once to replace the original 2 GB disk that was in there, and I have no intention to ever do it again...

Wiebel, aren't the extended partitions affected by deleting hda2? I can resize hda6 and create additional partitions further down towards the end of the disk rather easily, but squeezing in additional primary partitions further up the disk? How do I let hda5 and 6 know that they now belong to hda4, not 2 anymore?
Back to top
View user's profile Send private message
gilesjuk
Guru
Guru


Joined: 11 Feb 2003
Posts: 412
Location: Staffordshire, UK

PostPosted: Sun Feb 23, 2003 2:00 pm    Post subject: Reply with quote

You can actually run Partition Magic from floppy, two disks are required but it does provide you with the full interface of PM.
Back to top
View user's profile Send private message
jgmcbride
n00b
n00b


Joined: 16 Feb 2003
Posts: 27
Location: New York NY

PostPosted: Sun Feb 23, 2003 2:39 pm    Post subject: Reply with quote

From what I can see your Win D: drive is the killer here. 10 gig.
If it is full then you have large problems. If you are only using a small portion of it then zip and move this data to your Win C: drive. The objective here is to get your data off Win D: before you play around with it. You can then use parted to resize it.

If you have a spare machine you can always backup your critical files to another machine either with laplink or over the network.

I would expect that you have all your critical files backed up anyway. I have found that even a complete reinstall is not that big a deal for me. I place all my critical files (where possible) in one or two directories and then simply have to back these up. After I rebuild I simply have to restore these and after about an hour's tweaking I am ready to go again.

Let us know when/if you have your D: drive backed up and we can address it from there.
Back to top
View user's profile Send private message
bluesky
Apprentice
Apprentice


Joined: 14 Aug 2002
Posts: 230
Location: USA

PostPosted: Sun Feb 23, 2003 2:57 pm    Post subject: re:gnu parted Reply with quote

Your partition layout looks good and if I understand correctly, you ONLY want to keep /dev/hda1 so it would be pretty easy to do. Just "rm" /dev/hda2 then start from there.

Gnu Parted is not difficult to use but you need some time to get used to it. And you only need to use parted to "resize" /dev/hda1 which should not cause any problem but reread the manual about "resize".

The remaining operations you can use fdisk and mke2fs. I suppose that you are familiar with fdisk. :wink:
_________________
bluesky

"free as the wind"
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Sun Feb 23, 2003 3:23 pm    Post subject: Reply with quote

Sure. No, what's baking my noodle is how to resize hda1 while it's mounted, and how I can save hda6 from being blown into oblivion when I delete hda2... :) The only thing I can think of is to tar everything on hda1 into a file in /home, resize and move hda6 to a place somewhere up the drive, boot from floppy, resize hda1, make2fs, mount hda6, untar, edit fstab to reflect all of Mandrake in hda6, boot Mandrake, fdisk again, now comes the tricky part: delete hda2, create hda2, hda3, hda4? Will that work without hda5 and 6 getting lost?

jgmcbride: I don't have a D: disk. You're talking to the wrong person, try reading the top post in this thread... gilesjuk: Partition Magic doesn't even support the filesytem I currently have on that disk, let alone any of those I intend to put on there.
Back to top
View user's profile Send private message
bluesky
Apprentice
Apprentice


Joined: 14 Aug 2002
Posts: 230
Location: USA

PostPosted: Sun Feb 23, 2003 3:46 pm    Post subject: re: gnu parted Reply with quote

>what's baking my noodle is how to resize hda1 while it's mounted,

use parted floppy.

Sorry I didn't know that you want to keep /dev/hda6 too. Hmm this is going to be tough. Surely, if you delete the extended(hda2) then you will lose everything in it including hda6. If hda1 has enough room you can move the data in hda6 temporarily to it. if not you can try to move it some where else to another hard disk maybe. The last option is to resize hda2(extended) at the same time make sure that after resizing it still includes hda6. Theorically it should work but I haven't done this before so you will be on your own. :wink:
_________________
bluesky

"free as the wind"
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Mon Feb 24, 2003 12:50 am    Post subject: Reply with quote

bluesky wrote:
use parted floppy.

Resizing the mounted hda1 was a joke, don't worry. 8) Well, I think I'll have to give up on the project. Looks like my only way out is to tar everything and temporarily place it on one of the other computers around the house while I do some serious disk cleaning. hda1 has 3.5 GB, 3.6 of which are used :P , so your other MO isn't really an option here, either. Word of advice to any and all who accidentally venture by this thread: Carefully plan your disk layout before you entrust something like Mandrake's automatic disk partitioner Diskdrake with making the choices for you. Had I been less ignorant eight months ago, I certainly would have wanted someone to say that to me... :evil:

Guess I'll change the hostname to Augeias and do some serious cleansing... :D
Back to top
View user's profile Send private message
Wiebel
n00b
n00b


Joined: 05 Feb 2003
Posts: 60
Location: Bad Homburg, Germany

PostPosted: Sat Mar 01, 2003 4:15 pm    Post subject: Reply with quote

plate wrote:
I'm sorry, but neither do I have a Windows partition
Wiebel, aren't the extended partitions affected by deleting hda2? I can resize hda6 and create additional partitions further down towards the end of the disk rather easily, but squeezing in additional primary partitions further up the disk? How do I let hda5 and 6 know that they now belong to hda4, not 2 anymore?


Sorry for my late (hope not too late) answer. :oops:

I do think just deleting hda2 won't do any harm. Of course when you do so hda5+6 will vanish. You then have to recreate hda4 then again hda5+6 in exactly the same boundaries. I wouldn't say it will work if you will only rebuild 5 or 6 but with exactly the same Layout the ext should be the same only with another name. I do know the scary moments when highly needed partitions go away, but you can just try it if it works cool, if it dosn't just hack back the original partition table and you got your system back (as long as you don't write on the altered partitions).

I hope this answers your question.

Good Luck.
Back to top
View user's profile Send private message
abhishek
Retired Dev
Retired Dev


Joined: 28 Jun 2002
Posts: 393
Location: Los Angeles, CA

PostPosted: Sat Mar 01, 2003 9:32 pm    Post subject: Reply with quote

When you reinstall, if you do, you might want to use LVM and/or EVMS as they both make it easy and safe to resize paritions, among other things.
Back to top
View user's profile Send private message
Wiebel
n00b
n00b


Joined: 05 Feb 2003
Posts: 60
Location: Bad Homburg, Germany

PostPosted: Sun Mar 02, 2003 2:25 am    Post subject: Reply with quote

andrd wrote:
When you reinstall, if you do, you might want to use LVM and/or EVMS as they both make it easy and safe to resize paritions, among other things.

Yes, absolutely! It makes things really easier. I do hope EVMS will make it into the 2.4.6 kernel. It's a great improvement of lvm, raid, life, the universe ...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum