Jump to content

Partitioning HD [solved]


Recommended Posts

I don't have enough space on / in Debian so I wanted to create a new /usr partition from /home. I booted into Mandriva One, went to mcc and disk partitioning. Clicked on /home, unmounted it and then clicked on resize and it told me that partition was not resizable. Any ideas?

Link to comment
Share on other sites

The easier way to resize it is boot in single mode and then do it from the command line. What filesystem type is it? ext3? reiserfs? etc, etc?

 

I just deleted home and resized /var to use the space /home was using on an install I had. For you however, it's easy, since you just need to change /home mountpoint to /usr instead. Do this:

 

1. Tar the contents of /home like this:

 

tar cvjpf home.tar.bz2

 

those parametes will make a bzip2 file and will keep the permissions on all files for when you extract them again. It's important for any user accounts you have on your system.

 

2. Make a directory called /usr2 and unmount /home and mount it to /usr2 removing the contents of /home since you don't need anymore. Copy the contents of /usr to /usr2 like this:

 

cp -dpRx /usr/* /usr2/

 

again, this will keep permissions on all files. Now, edit /etc/fstab and create entry for /usr. Unmount /usr2. Remove the existing contents /usr and reboot your system. Untar the home.tar.bz2 to /home. All this will have to be done from rescue cd or similar.

 

Alternatively, if you need to keep /home, then I suggest you use the command line resize tools, but it's not as easy as you think since you then have to use fdisk to delete, and then recreate the partition smaller than it was, but big enough to accommodate what data is already there. Also, perhaps parted will do what you need, but again rescue or single user mode to do this.

 

And remember, backup your data in case it goes wrong.

Link to comment
Share on other sites

Well I took pmpatrick's advise and I found out why I can't resize /home. It's showing that it's full and it's a 20GB partition with maybe 1 GB being used. Any ideas on how to fix this? I really don't want to delete /home. I just want to resize it.

Link to comment
Share on other sites

How do you know it's only using 1GB of space then, if df shows it's full? :unsure:

 

I'd be considering looking at archiving whatever stuff you've got there, or deleting what you don't need to reclaim some space. I'm kind of having a hard time trying to understand how 1GB is equating to 20GB though. Unless something was being misreported somewhere.

 

What you can do, is this:

 

cd /home
du -sh `ls`

 

will give you summary listing by directory. If only one user, go into the user directory itself, and rerun the same command again so you can find out where all the space is going.

Link to comment
Share on other sites

I found out what's happening and I can't figure out why. My /home is reporting as only 283 MB when I know the partition was over 20 GBs. I'm going to back up everything on a CD. Delete the partition and create a /usr and a /home. Do I have to copy everything over from my old /usr directory to the new partition?

Link to comment
Share on other sites

Yup, since /usr will be in the / partition as it stands now. /usr holds all your programs, binaries, everything. So you definitely need to copy it over and empty the original /usr directory before mounting the new /usr.

Link to comment
Share on other sites

/dev/hda7 was home of 20gb. It was deleted. /dev/hda7 became 10gb for /usr, /dev/hda8 became 10gb for /home.

 

Copied /usr to new partition.

Recreated /home/username directory from cd backup of user.

Cleared old /usr directory ready for new partition to mount here.

chown new user directory.

Edited /etc/fstab to mount new mount points.

 

Quick summary of how we increased space on /.

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...