LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-08-2008, 07:54 PM   #1
scofiled83
Member
 
Registered: Nov 2008
Posts: 70

Rep: Reputation: 15
partitioning


Hi there

My Linux system’s disk is partitioned as follows:
center; l | l | l . DEVICE MOUNT POINT SIZE _ hda1 / 100Mb hda5 /usr 2048Mb hda6 /home 10Mb hda7 /var512Mb hda8 swap 12Gb

There is 4Gb of unpartitioned free space remaining on the disk (in the logical extended partition)

The /usr partition is running out of space, mostly because of files under /usr/local.

how can I create a new partition for /usr/local, and move the contents to there
 
Old 11-08-2008, 08:05 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
going from memory on this...

Code:
fdisk /dev/hda
 n(ew partition)
 l(ogical partition)
 <take the starting>
 <take the ending>
 p(rint to make sure it is correct)
 w(rite if it looks good)
then, reread the partition table into kernel partprobe /dev/hda (or reboot)
format it with a filesystem (ext3?),
mount it somewhere temporarily,
copy (rather than move in case you need to try again) the files from /usr/local/ to the hda9 temporarily mounted location,
add an entry into /etc/fstab so it mounts at boot in the correct location (/usr/local),
depending on what is running and has any files open lsof | grep \/usr\/local you might be able to just unmount it from temporary location and mount it to /usr/local and go, but if there are open files and you are unable to safely terminate whatever is holding them then you may wish to either boot to single-user, rescue cd, or a live-CD and copy the data to keep the data static until it comes up on the hda9 partition


as far as copying, you can use cp, tar, rsync, or any other number of available ways
 
Old 11-08-2008, 08:39 PM   #3
scofiled83
Member
 
Registered: Nov 2008
Posts: 70

Original Poster
Rep: Reputation: 15
Hi thanks for ur reply
If the filesystem is mkreiserfs in fstab

I can format and create it by

mkreiserfs /dev/hda9

if it is ext3 how can I do that?
 
Old 11-08-2008, 09:11 PM   #4
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
If you are already using reiserfs on others, no reason you couldn't proceed with it on this one too, but to answer your question...

Code:
mkfs -t ext3 /dev/hda9
or
Code:
mke2fs -j /dev/hda9
or
Code:
mkfs.ext3 /dev/hda9
or any other possible link, script, wrapper, method your OS supports.

You get to decide what fs you would like to use. If your installation formatted your other partitions with reiserfs I'd go ahead with reiserfs on this one too for consistency.
 
Old 11-08-2008, 09:48 PM   #5
scofiled83
Member
 
Registered: Nov 2008
Posts: 70

Original Poster
Rep: Reputation: 15
thanks again.
These are the steps I`ll perfom..Is it true at first glance?

fdisk /dev/hda
n(ew partition)
l(ogical partition)
<take the starting>
<take the ending>
p(rint to make sure it is correct)
w(rite if it looks good)

vi /etc/fstab
add mount point ( /tmp/backup) and ext3 as a filesystem.

mkfs -t ext3 /dev/hda9
mount /dev/hda9


cd /usr/local
for file in *
do
cp ${file} /tmp/backup/${file}
done


vi /etc/fstab
update mount point to /usr/local
 
Old 11-08-2008, 10:09 PM   #6
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
looks ok to me.
not sure on the for loop, but as long as it does what you want...



I personally would probably go with something like:
cd /usr/local/ && cp -a * /tmp/backup/
or
cd /usr/local/ && rsync -v -L -a -R -W --progress . /tmp/backup/

...again, six to one, half-dozen to another... as long as you get the end result you are after
 
Old 11-08-2008, 10:29 PM   #7
scofiled83
Member
 
Registered: Nov 2008
Posts: 70

Original Poster
Rep: Reputation: 15
thanks for ur help
 
  


Reply



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 cherith.brook Linux - Newbie 5 01-31-2008 09:20 PM
Partitioning Help covert215 Linux - General 8 08-22-2006 05:21 PM
Partitioning alexidoia Linux - Newbie 2 10-11-2004 03:41 PM
partitioning PlatinumRik Linux - Software 6 04-10-2003 07:11 PM
Partitioning? stalefx Linux - Software 4 04-08-2003 08:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:04 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
Open Source Consulting | Domain Registration