LinuxQuestions.org
Review your favorite Linux distribution.
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 01-04-2005, 08:42 AM   #1
1speedjb
LQ Newbie
 
Registered: Aug 2004
Location: rural PA
Distribution: fedora
Posts: 9

Rep: Reputation: 0
partition mount redo


I just loaded a desktop as a dual boot with XP and Fedora. I set up all of my partitions successfully, but as I was installing Linux, I didn't set a mount point to my second Linux partition (I have two main partitions set up for use with Linux, one for the OS and one for my data; a third partition is for swap). So I pointed my / mount to the right partition, but didn't define the mount point for the partition I want to use for data directories.

I'm thinking that I'd like to assign the data partition as /home. I haven't done anything with the machine yet, so it wouldn't be a big deal to just reinstall, but there must be a more elegant way than that to repoint my /home directory to an open partition.

Thanks in advance for your help.

JB
 
Old 01-04-2005, 12:36 PM   #2
Mikhail_16
Member
 
Registered: Oct 2003
Distribution: Gentoo rules them all
Posts: 279

Rep: Reputation: 31
the easiest way i can think of would be to either boot knoppix and edit /etc/fstab on the root drive or boot red hat recovery console from install cds remount disk to read write and also edit /etc/fstab. unless of course your system already boots, then just edit fstab when booted, format and mount your future /home on /tmp, then copy (or move) everything from current /home to new /home (that's right now on /tmp), check that you setup /etc/fstab correctly and reboot. once it comes up your /home will be on the new place.

I know i gave very generic info here, if you need actual commands let me know and i'll write out the exact directions.
 
Old 01-04-2005, 01:48 PM   #3
1speedjb
LQ Newbie
 
Registered: Aug 2004
Location: rural PA
Distribution: fedora
Posts: 9

Original Poster
Rep: Reputation: 0
Cool. Everything boots up fine, so that makes things easy. I'm going to try to take a crack at this now, and I'll apply it later when I get home. I think I've got it, but let me know if I'm screwing things up.

There are a few steps here...

In fstab, I would want to have a line that looks like this:

/dev/hda5 /home ext2 defaults 0 0

Then in terminal, if the partition is not formatted, I would want to:

mkfs.ext2 /dev/hda5

Then I would move the contents of the /home folder to /tmp/home, and delete the original /home folder. When I reboot, the computer should recognize /dev/hda5 as the /home directory, and I can move everything from /tmp/home back to /home.

That's what I was thinking, but I didn't want to destabilize the system.
Thanks a lot.
 
Old 01-04-2005, 04:16 PM   #4
Mikhail_16
Member
 
Registered: Oct 2003
Distribution: Gentoo rules them all
Posts: 279

Rep: Reputation: 31
Quote:
Originally posted by 1speedjb
Cool. Everything boots up fine, so that makes things easy. I'm going to try to take a crack at this now, and I'll apply it later when I get home. I think I've got it, but let me know if I'm screwing things up.

There are a few steps here...

In fstab, I would want to have a line that looks like this:

/dev/hda5 /home ext2 defaults 0 0

Then in terminal, if the partition is not formatted, I would want to:

mkfs.ext2 /dev/hda5

Then I would move the contents of the /home folder to /tmp/home, and delete the original /home folder. When I reboot, the computer should recognize /dev/hda5 as the /home directory, and I can move everything from /tmp/home back to /home.

That's what I was thinking, but I didn't want to destabilize the system.
Thanks a lot.
Alright since you missed a critical step i'll go into details on commands:

hda5 is the partition for new /home


fstab:
/dev/hda5 /home ext3 defaults 0 0
as root:
mke2fs -j /dev/hda5 (make partition ext3, ext2 is too old)
mount /dev/hda5 /tmp (mount hda5 onto /tmp folder)
mv /home/* /tmp/ (move /home will also take care of erasing contents of /home by not leaving a copy)
ls -l /tmp (this will show stuff like user1, user2, etc)
umount /tmp (cleanly unmount hda5)
reboot

and you are done.
 
Old 01-05-2005, 10:38 AM   #5
1speedjb
LQ Newbie
 
Registered: Aug 2004
Location: rural PA
Distribution: fedora
Posts: 9

Original Poster
Rep: Reputation: 0
Awesome. Thanks so much for your help. Everything is all set up.
Last night I was also able to mount a Windows partition, get my modem configured, and set up the printer. I'm riding high on a wave of Linux victory

Cheers,
JB
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
A command to redo my network connections? donJulio Slackware 3 09-17-2005 08:38 PM
How to resize a partition and create/mount a new partition? Maarten_Holland Linux - Newbie 1 04-20-2005 09:56 AM
Redo Linux Partitions & Clean Format Thanatos Linux - General 2 12-22-2004 02:05 PM
Stuff I need to redo when I reboot sammckee Linux - Newbie 3 09-27-2003 09:57 AM
Mount the partition Hammad Linux - General 0 03-19-2003 05:11 AM

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

All times are GMT -5. The time now is 05:34 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration