Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-15-2004, 11:00 PM
|
#1
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Rep:
|
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
/dev/hda1 / reiserfs defaults 1 1
/dev/hda3 /usr reiserfs defaults 1 2
/dev/hda5 /opt reiserfs defaults 1 2
/dev/hda6 /var reiserfs defaults 1 2
/dev/hda7 /tmp reiserfs defaults 1 2
/dev/hda8 /home reiserfs defaults 1 2
/dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
df -h:
Code:
shilo@shilo2:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 4.7G 170M 4.5G 4% /
/dev/hda3 19G 2.5G 17G 14% /usr
/dev/hda5 4.7G 426M 4.3G 9% /opt
/dev/hda6 38G 478M 37G 2% /var
/dev/hda7 4.7G 33M 4.7G 1% /tmp
/dev/hda8 41G 16G 26G 38% /home
Let me know if there is any other info that would be helpful.
Thanks in advance,
Last edited by shilo; 07-15-2004 at 11:01 PM.
|
|
|
07-15-2004, 11:19 PM
|
#2
|
Member
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153
Rep:
|
yeh
Partition Magic will do it perfectly.
|
|
|
07-15-2004, 11:29 PM
|
#3
|
Member
Registered: Mar 2003
Location: St. Louis, MO
Distribution: kubuntu-current
Posts: 551
Rep:
|
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
Last edited by tw001_tw; 07-15-2004 at 11:37 PM.
|
|
|
07-16-2004, 12:42 AM
|
#4
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Original Poster
Rep:
|
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,
|
|
|
07-16-2004, 12:47 AM
|
#5
|
Member
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153
Rep:
|
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.
:-)
|
|
|
07-16-2004, 01:12 AM
|
#6
|
Member
Registered: Mar 2003
Location: St. Louis, MO
Distribution: kubuntu-current
Posts: 551
Rep:
|
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
|
|
|
07-16-2004, 01:26 AM
|
#7
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Original Poster
Rep:
|
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,
|
|
|
07-16-2004, 03:16 AM
|
#8
|
Member
Registered: Jun 2003
Location: Canada
Distribution: Slackware (current); Gentoo (newbie)
Posts: 142
Rep:
|
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
|
|
|
07-16-2004, 04:36 AM
|
#9
|
Member
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153
Rep:
|
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 12:35 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|