Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parted question - scared to death

Status
Not open for further replies.

skip777

Instructor
Nov 1, 2002
4
US
I need to repartition my hard-drive because I am running out of room in /var.

I want to move 3 megs from /usr to /var

Here are the specs. Does anyone have the experience to answer the question?
I pretty much need a step-by-step script to get it done.

df -h dump

Filesystem Size Used Avail Use% Mounted on
/dev/hda5 372M 178M 175M 51% /
/dev/hda1 45M 5.7M 37M 14% /boot
/dev/hda3 9.8G 273M 9.0G 3% /home
none 62M 0 61M 0% /dev/shm
/dev/hda2 27G 1.3G 24G 6% /usr
/dev/hda6 251M 154M 84M 65% /var

fstab listing
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
LABEL=/home /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
/dev/hda7 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1 /mnt/cdrom1 iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
 
Hi,

I can't understand why you want to move megs from /usr to /var whereas you need space in /var ??? At least, can a simple "mv" be enough ?

(suppose you want to move /usr/local/foo to /var/foo)
cd /usr/local
mv foo /var
ln -sf ../../var/foo foo

And it's better if nobody access this directory while you move it (maybe need to boot in single-user mode)
 
I think skip means he wants to reallocate free space in /usr to /var.

If that is the case 3 Mg seems a measly amount given the space available within /usr?
 
Ken got it right.

3 megs may not be enough in the long run, but what I have in var isn't. So does anybody have an answer?

From the parted docs it looks like I have to create a new partition inside the usr partition of let's say 3 megs in size and move the existing var partition over to it and then
delete the old /var partition. I would then have to resize
the adjacent partition to the size of the deleted partition so that it occupies the available space.

Finally, I would need to edit fstab to reflect the changes.

I understand the problem, I just don't want to trash my
system. That's why I asked for expert help.
 
My bad on two counts.

I want to move house /var in a new partition that was
occupied by /usr.

3 gigs, not megs, would probably be enough. I could then keep my mysql tables comfortable as well. If anybody knows of a better repartitioning than parted, I would be glad to hear about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top