re-partitioning question
I recently built a new computer. I put a 120G hard drive in it. Everything has been going great, but I recently realized that I made an error in estimating partition sizes. I have a /home parition (40G) and a /var partiton (40G). I would like to change this and make it so that I have a /home partition (70G) and a /var partition (10G).
Would anyone care to give me a step by step guide on how to go about doing this. I have plenty of space on my other partitions to copy the current contents of /var and /home so that I don't lose any of my current data. Just in case any of this helps, here's a bit of info on my current box: /etc/fstab: Code:
/dev/hda2 swap swap defaults 0 0 Code:
shilo@shilo2:~$ df -h Thanks in advance, |
yeh
Partition Magic will do it perfectly.
|
shilo,
I would do exactly what you suggested - copy the files to anather directory, cfdisk hda, del hda6 (var) and hda8 (home) - recreate them to the size you want and copy the files back. cp -prv (source) (destination) please double check that command - I am thinking: -p to retian permissions -r to do sub directories and -v becuase I like to watch things work oh, and mkreiserfs /dev/hdaX to format - forgot that one then cp -prv (source) (destination) good luck - tw |
WOw, thanks for the quick responses.
SirSlappy- Thanks. That's not quite what I was looking for. I believe that cfdisk will do the same thing as Partition Magic. It just creates partitions, right? I have never used it, so I could be wrong. I also believe that Partition Magic is a commercial product. While I have no problem with paying for commercial software that I find useful, I'm a little hesitant when I believe that all of the tools that I require were included with Slackware. tw001_tw- I think that we are thinking along the same lines. Going with that, and seeing the amount of diskspace I have, I believe the steps are: 1) mkdir /tempvar 2) cp -prv /var /tempvar 3) mkdir /usr/temphome 4) cp -prv /home /usr/temphome 5) Use Slackware 10 installation disk 2 to boot up 6) cfdisk 6a) While in cfdisk, delete /dev/hda6 and /dev/hda8 6b) Still in cfdisk, re-create new partitions with sizes 10G (hopefully /dev/hda6) and 70G (hopefully /dev/hda8) 7) mkreiserfs /dev/hda6 8) mkreiserfs /dev/hda8 9) reboot 10) cp -prv /tempvar /var 11) cp -prv /usr/temphome /home 12) Reboot (?) 13) rm -r /tempvar 14) rm -r /usr/temphome That sould do it. Anyone have any comments? Will this get me to where I want to be? The only (2) problems that I forsee is cfdisk remaming the partitions something other than /dev/hda6 adn /dev/hda8 (in that case, I just edit /etc/fstab , right?) and knowing whether or not the computer will reboot after the cfdisk (it should, shouldn't it?). I won't be making any changes to the system until at least Sunday, so any comments or advice is welcome. Thanks again, |
ahh
sorry, man. lol . I just have access to lots of software and Pmagic is just really easy. I'm used to helping newbies.
Looks like you have it figured out. :-) |
shilo,
I am not sure why the reboot on step 5 . cfdisk is on the drive (/usr/sbin/cfdisk) (at least for me - full install) and accessible by root (which I am guessing for simplicity you will use for this task.) Just a thought, you may want to delete and create the partitions one at a time, instead of deleteing both, and then making both. That might help assure that /var is once agian hda6 and /home is hda8. You can also double check everything before you 'write' the partition table. Technically, it is advised you reboot after a partition creation - however the initial slackware installation does not reboot after a partition creation. just a thought. I have read over your plan a few times - looks good as far as I can tell. PLEASE double check my info!!!! :) -tw |
SirSlappy-
Thanks. No disrespect intended. I don't know anything about Partiton Magic, but like I said, my understanding is that it does the job of cfdisk. I would be left missing the data that is currently on my drives. I really should check that program out, as I see a lot of people recommending it. tw001_tw- I wasn't sure on the reboot/ using the Install disk thing either. I just wasn't sure if I could do everything on my box while hosing the /var partition. I am not worried about the /home partition, since I'll be doing everything as root. Good idea on doing things one at a time, though. I'm gonna re-pencil out my plan again doing things one at a time. I'll definately double check things. That was my main though in posting my question. I figured that if I got it right, others would be able to see how it's done. If I got it wrong, somebody would correct me nad others would still see how it was done. Thanks again to everyone for the help, |
I haven't done this myself, but I have a few clarifying questions to address some niggling thoughts I have:
- do you plan to go into single user mode before copying the files from var? this might be a good idea to ensure that only minimal changes will be made to it after you take the snapshot - why not just use `cp -a` which copies all file attributes (permissions, ownership, etc). - it looks like you're saying you're going to try to reboot with a freshly-formatted (blank) /var partition. This will probably work for home (as long as you log in as root immediately after the boot and copy the stuff over, but I don't think it will work for /var. You should copy the tempvar folder back to the new partition immediately after formatting it. - You should also double-check the partitions in /etc/fstab before rebooting for good measure. This should be pretty easy to do: just `fdisk -l` (lower-case L for list). Garry |
nah..
you won't lose any data. Partition magic can just swap space from partition to partition, etc.
Anyway. Glad you got it figured out. I'm ashamed to recommend something that's pretty much for windows, but it's a good program for partitioning. Anyway, man. Have a good'n. |
All times are GMT -5. The time now is 05:16 AM. |