Jump to content

Creating a New Partiition by Dividing /home?


Steve Scrimpshire
 Share

Recommended Posts

I didn't put enough space for /usr when I created my original install and way too much on /home for a single-user system, and someone told me that I could resize home and create a new mountpoint for /usr/local to give me the space I need, but how? Do I have to boot into single-user mode? I've tried Rescue, but cannot use DiskDrake in it and I've tried to Update the install, but it takes me past DiskDrake there. Trying to run DiskDrake won't let me unmount /home any other way.

 

TIA for any advice.

Link to comment
Share on other sites

There are ways to do this, with a 50/50 chance of actually working. I would recommend the following fun-packed adventure:

1) make a partition the size of your future /usr. Call it /bob , or /fred, anything but /usr.

2) back-up /home into the new partition.

3) Reinstall using expert mode. Do not overwrite the what-ever-you-called-it partition.

4) When done, copy backup data into the new smaller /home partition. After verification, erase the data in the partition.

5) use diskdrake to move the /usr into the now vacated larger partition.

 

The down side to this is you need the room on the drive to make the partition, and if you want to preserve /home and /usr, you need even more room! Diskdrake can do this without the reinstall, but my personal success rate at doing this wothout backup is 1 failure in 5 successes. So beware, you can lose your data. It is smarter to backup.

Link to comment
Share on other sites

Well, I was hoping a reinstall was not necessary. I can almost (if my math is right) move the contents of /usr into /home (that's how much too big it is) and then resiize /usr down to where I need /home to be sized down to and then move /home into there. Actually I think I have room to fit /usr into /home. What is the other way of resizing /home without reinstall? Here's my disk space usage:

Filesystem           1k-blocks      Used Available Use% Mounted on

/dev/hda5               505996    430760     75236  86% /

none                         0         0         0   -  /proc

none                         0         0         0   -  /dev/pts

none                    193096         0    193096   0% /dev/shm

/dev/hda6              4634572    945000   3689572  21% /home

/dev/hda1              6202784   4580224   1622560  74% /mnt/windows

/dev/hda7              3060248   2725748    334500  90% /usr

Link to comment
Share on other sites

See, that's the real trick. Diskdrake, or other partitioning tools, can alter the size of partitions with the data in them. But anytime you mess with a happy partition, you run the risk of losing all the data. I have resized /usr before, in order to get more room. (I did the same mistake!) I have never resized and moved two partitions. It does sound like fun!

Link to comment
Share on other sites

If windows is fat, go to init 3 and login as root

#cd /mnt/windows

#tar -zcf home.tar.gz /home

#diskdrake

choose /dev/hda6 /home>unmount>format with a new mount point /usr>diskdrake will tell you that there already is a /usr, and ask if you want to copy the files over to the new partition, or hide the files. Copy them over. Unfortunately it doesn't appear from df (df -h for human readable) that you have a way to bkup /usr. Diskdrake has failed me one time out of about 6 and not copied the files over. If not already, mount the new /usr>Ctrl+Alt+F2>login as root and verify the new files are there

#ls -a /usr

Then logout of tty2, Ctrl+Alt+F1 to diskdrake>If there, choose /dev/hda7 /usr (old /usr) same as above but make it /home, or create a new with a mount point /home>mount /home>close diskdrake and verify /home is there

#cd /

#ls -a

#df -h

#vim /etc/fstab (to make sure all looks ok)

then

#cd /mnt/windows

#mv home.tar.gz /home

#cd /home

#tar -xzf home.tar.gz

#ls -a

cross the fingers and

#reboot

 

It's late, so please, everyone look over this...goodnight :wink:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...