LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 03-28-2004, 12:11 PM   #1
kkdw
LQ Newbie
 
Registered: Mar 2004
Distribution: red hat
Posts: 4

Rep: Reputation: 0
How add a partition to mount on /usr directory on run time


I am using red hat 7.0 .
/usr directory is in / directory.
I want to add a partition without reinstalling so that it mounts on /usr directory ( there by increasing space in /usr directory and also in / directory) and my system still functioning properly
 
Old 03-28-2004, 12:45 PM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
# Clone a distro to another drive or move directories around
Install drive in box (assuming IDE1 slave for examples) and ensure BIOS can detect it. Boot into Linux and login to your user's account. Open an x terminal and partition and format the new drive as you wish
Code:
[fancy@tinwhistle fancy]$ su -
Password: 
[root@tinwhistle root]# fdisk /dev/hdb
Exit with w to write the partition table.

Format the partitions with the chosen filesystems:
mke2fs /dev/hdbX -> ext2
mke2fs -j /dev/hdbX -> ext3
mkswap -> swap
mkreiserfs -> reiserfs
mkfs.xfs -> xfs

Make directories for source and destination mount points. You need these to keep out of an endless loop of copying itsself over and over.
Code:
[root@tinwhistle root]# mkdir /mnt/source
[root@tinwhistle root]# mkdir /mnt/destination
Mount your os partitions that you want to clone on /mnt/source
Mount your partitions on the new drive, making directory entries for your separate partitions (/boot, /home, /var etc.). If you are just copying a directory such as var, just cd to the directory you wish to copy instead of mounting partitions on /mnt/source.

Now, cd to /mnt/source and pipe it over with tar
Code:
[root@tinwhistle root]# cd /mnt/source
[root@tinwhistle source]# tar cf - . | (cd /mnt/destination && tar xBfp -)
Edit /etc/fstab as needed, install the boot loader if you moved a whole distro, and it should work when it is installed in it's final position.


# Red Hat links
Red Hat Linux Manuals
Get your mp3 support here
Maximum RPM
rpmfind
Easier software management: apt4rpm - Red Carpet
Red Hat 8.0 Tips & Tricks

# Red Hat 7.3 down configuration commands
setup leads to several configuration tools

# Red Hat 7.3 up configuration commands
Configure soundcard:
redhat-config-soundcard
Configure X server:
redhat-config-xfree86
Configure network:
redhat-config-network
Manage software:
redhat-config-packages
Red Hat Linux 8.0 Package Management Tool
Red Hat 9.0 Package Management Tool
Manage users
redhat-config-users

# Handling NTFS
New Technology FileSystem (NTFS) HOWTOs
Linux NTFS project
 
Old 03-31-2004, 12:00 PM   #3
kkdw
LQ Newbie
 
Registered: Mar 2004
Distribution: red hat
Posts: 4

Original Poster
Rep: Reputation: 0
thanks , I will try that

Last edited by kkdw; 03-31-2004 at 12:05 PM.
 
Old 03-31-2004, 12:06 PM   #4
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
Boot in single-user mode (so the programs in /usr won't be running) by adding the 'single' option at boot.
Use these commands (assuming the partition is formatted):
mv /usr /usr.old
mkdir /usr
mount [new usr partition] /usr
umask 000
cp -a /usr.old/* /usr

Now add a line to the /etc/fstab so it will mount at boot:
[new partition] /usr [fstype] defaults 0 0
Test it out. If it works, delete /usr.old:
rm -r /usr.old
 
Old 03-31-2004, 12:17 PM   #5
kkdw
LQ Newbie
 
Registered: Mar 2004
Distribution: red hat
Posts: 4

Original Poster
Rep: Reputation: 0
That's what i was thinking to do but i was not so sure. I am not so sure even now. However using tar command seems to be more promissing.
Thanks for helping me.
 
  


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
can I move the /usr directory to another partition? walterbyrd Linux - Newbie 4 07-10-2005 07:24 PM
`/usr/man/man3' is not a directory satimis Linux From Scratch 1 07-09-2005 08:53 PM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 09:21 AM
usr directory on suse 8.2 ronss Linux - Distributions 2 09-02-2003 02:20 AM
Need to add /usr/lib to PATH for RPM? SForsgren Linux - General 11 05-16-2003 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 02:19 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