LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-15-2004, 11:00 PM   #1
shilo
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: Reputation: 50
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.
 
Old 07-15-2004, 11:19 PM   #2
SirSlappy
Member
 
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153

Rep: Reputation: 30
yeh

Partition Magic will do it perfectly.
 
Old 07-15-2004, 11:29 PM   #3
tw001_tw
Member
 
Registered: Mar 2003
Location: St. Louis, MO
Distribution: kubuntu-current
Posts: 551
Blog Entries: 4

Rep: Reputation: 31
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.
 
Old 07-16-2004, 12:42 AM   #4
shilo
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: Reputation: 50
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,
 
Old 07-16-2004, 12:47 AM   #5
SirSlappy
Member
 
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153

Rep: Reputation: 30
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.

:-)
 
Old 07-16-2004, 01:12 AM   #6
tw001_tw
Member
 
Registered: Mar 2003
Location: St. Louis, MO
Distribution: kubuntu-current
Posts: 551
Blog Entries: 4

Rep: Reputation: 31
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
 
Old 07-16-2004, 01:26 AM   #7
shilo
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: Reputation: 50
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,
 
Old 07-16-2004, 03:16 AM   #8
major.tom
Member
 
Registered: Jun 2003
Location: Canada
Distribution: Slackware (current); Gentoo (newbie)
Posts: 142

Rep: Reputation: 15
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
 
Old 07-16-2004, 04:36 AM   #9
SirSlappy
Member
 
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Partitioning Question gamedev86 Linux - General 5 03-01-2005 07:13 PM
Another Partitioning Question Wamzlee Mandriva 5 02-14-2005 04:11 PM
partitioning question pablowablo Linux - General 2 02-12-2005 11:38 PM
Question re: partitioning Seventh Linux - Newbie 6 01-04-2004 01:32 PM
Partitioning Question MrJBot Linux - Newbie 12 10-21-2003 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration