Stop Microsoft

Operating Systems => Linux and UNIX => Topic started by: Doogee on 11 November 2002, 12:57

Title: /home
Post by: Doogee on 11 November 2002, 12:57
Hey.

I just made a new partition in the linux installer, it was the /home partition.

Now im in and the partition is under /mnt/disk/
how do i make this seperate partition the home directory?
Title: /home
Post by: voidmain on 11 November 2002, 14:03
Log off and log in as root, move all the data from /home to /mnt/disk, unmount /mnt/disk, change the /etc/fstab, mount /home:

# mv /home/* /mnt/disk
# umount /mnt/disk

Assuming /mnt/disk is on /dev/hda3, change /etc/fstab from:

Code: [Select]

to

Code: [Select]

then

# mount /home

Log off and log on as a normal user where your home directory (and all other users home directory) will be on the /home partition rather than the /home directory on the root partition.
Title: /home
Post by: Doogee on 11 November 2002, 14:12
Code: [Select]

Theres my fstab, im in mandrake, i changed over yesterday(sunday) so its got all this supermount shit that i dont have a clue about... a hand, anyone?
Title: /home
Post by: voidmain on 11 November 2002, 14:17
Apparently after creating your partition you mounted it manually on /mnt/disk. No problem, after moving the data and unmounting /mnt/disk, just insert the line I mentioned as the second line in your fstab:

Code: [Select]

Again, I am assuming your /mnt/disk is on /dev/hda3. Change "/dev/hda3" to whatever it *really* is. I am also assuming you created the file system on this partition as "ext3" which is what it needs to be.

[ November 11, 2002: Message edited by: void main ]

Title: /home
Post by: Doogee on 11 November 2002, 14:25
ok so i change

Code: [Select]

to


Code: [Select]

i just need to be clear, i had my red hat install fucked from the start, i wanna do it clean this time. sorry for any trouble void main.
Title: /home
Post by: voidmain on 11 November 2002, 14:29
No no no, don't change the "pts" line, *insert* the /dev/hda3 line before the "pts" line and after the "/dev/hda5" line. Also, did I just make a lucky guess on the partition being "/dev/hda3"? Check the real partition by typing "df /mnt/disk" and see if it really is on "/dev/hda3". If it's not, use whatever it says it is rather than "/dev/hda3".
Title: /home
Post by: Doogee on 11 November 2002, 14:33
ok this is just getting freaky,

i did the df thing and it came up with hda5, MY FRICKING LINUX PARTITION. what the fuck is going on here im very confused.
Title: /home
Post by: voidmain on 11 November 2002, 14:35
Let me ask you this. Just *how* did you make the new partition? Did you actually create a file system after making the partition? Did you mount it after creating the file system? You can do an:

# fdisk -l /dev/hda

to see all your partitions. Why don't you run that command and copy the output into this thread. We'll figure out what you are doing.   (http://smile.gif)

[ November 11, 2002: Message edited by: void main ]

Title: /home
Post by: Doogee on 11 November 2002, 14:38
fdisk not found, lol.

edit: by the way i used the mandrake installer graphical partition manager thing.

[ November 11, 2002: Message edited by: Doogee ]

Title: /home
Post by: voidmain on 11 November 2002, 14:39
Try:

# /sbin/fdisk -l /dev/hda
Title: /home
Post by: Doogee on 11 November 2002, 14:41
Code: [Select]
Title: /home
Post by: voidmain on 11 November 2002, 14:45
Ok, I see /dev/hda7 that is ~600MB that is not listed in your /etc/fstab. Could this be the partition you created? If so, is that enough room to hold everything currently under /home (du -sk /home)?

Also, if that is the correct partition, did you create a file system on it? Can't copy files to a partition, you can only copy files to a file system that resides on a partition. If you did create a file system you should be able to mount it on /mnt/disk:

# mount /dev/hda7 /mnt/disk
Title: /home
Post by: Doogee on 11 November 2002, 14:48
the mount had no errors. so whats the next step. we spent all this time looking for my partition. lol.
Title: /home
Post by: voidmain on 11 November 2002, 14:50
Now do a:

# df /mnt/disk

See if it shows "/dev/hda7" and then make sure there is nothing in it "ls -al /mnt/disk". Also make sure it is type "ext3":

# mount | grep /dev/hda7
Title: /home
Post by: Doogee on 11 November 2002, 14:58
heres a dump:


Code: [Select]

looks like everythings go?
Title: /home
Post by: voidmain on 11 November 2002, 14:59
Perfect. Now, make sure you have enough room in the new partition to hold everything currently in /home:

# du -sk /home
Title: /home
Post by: Doogee on 11 November 2002, 15:02
its a new install, so i have pretty much nothing in /home, a few rpms thats about it.
Title: /home
Post by: voidmain on 11 November 2002, 15:04
Ok then, the final thing to worry about is to make sure nothing has a lock on any files under /home. If you are logged on as root, and no other users are logged on then you should be good (root's home directory is not under /home).

Now just follow the directions in the previous note but use "/dev/hda7" where I originally said "/dev/hda3" starting at the:

# mv /home/* /mnt/disk

[ November 11, 2002: Message edited by: void main ]

Title: /home
Post by: Doogee on 11 November 2002, 15:06
alright ill log in as root now, ive been su'ing this whole time, brb, ill tell you the outcome.
Title: /home
Post by: Doogee on 11 November 2002, 15:35
help! i need to rollback that, i cant get into kde, i mustve fucked up somewhere, help me, im in black box using links cos mozilla wont start without access to $HOME.
Title: /home
Post by: voidmain on 11 November 2002, 15:41
Did the "/home" partition mount?

# df -k /home

Are the directories right on it?

# ls -al /home

P.S. Why can't you use Mozilla when logged in as root? root's $HOME directory is not under /home.

[ November 11, 2002: Message edited by: void main ]

Title: /home
Post by: Doogee on 11 November 2002, 15:46
/home didnt mount.

im logged on as user at the moment.
Title: /home
Post by: voidmain on 11 November 2002, 15:46
Type:

# mount /dev/hda7 /home

Then check your /etc/fstab, you must have made a typo in it.
Title: /home
Post by: Doogee on 11 November 2002, 15:48
fuck, i just got mount point /home does not exist. eek
Title: /home
Post by: voidmain on 11 November 2002, 15:51
You must have moved /home into /mnt/disk instead of moving "/home/*" to /mnt/disk. Type:

# mkdir /home
# mount /home
# ls -al /home

If the above works and you see a "/home/home" directory then my suspicions are correct. No problem, just do:

# cd /home/home
# mv * ..
# cd ..
# rmdir home
Title: /home
Post by: Doogee on 11 November 2002, 16:10
it just doesnt work, im gonna fuckit and format the partitions and reisntall. im thinking if i make the /home a seperate partition from the start then it will all be auto set up. do any mandrake users know if this is correct.
o well im gonna do it anyway.

thanks for the help void, im sure ill be needing more soon.

ahh its formatitn' time.
Title: /home
Post by: voidmain on 11 November 2002, 16:12
Oh, don't whimp out on me. You are almost there...
Title: /home
Post by: Doogee on 11 November 2002, 16:13
it just wont work, i have basically no access to linux, im in fucking windows and its already pissing me off.
Title: /home
Post by: voidmain on 11 November 2002, 16:16
You have no access to Linux?  How's that? Did you f00k up your /etc/fstab and the "/" filesystem is not mounting? If so, did you try booting in single user mode and fixing it? C'mon, this is the way you learn. Don't reinstall, that's a cop out.  (http://smile.gif)
Title: /home
Post by: Doogee on 11 November 2002, 16:18
all i know is on boot i get something like

[mtent]fstab error on line 4


line four is the fd0 config!!!!!!!!!!!!!
Title: /home
Post by: voidmain on 11 November 2002, 16:19
Does it stop there and not give you a login prompt?
Title: /home
Post by: Doogee on 11 November 2002, 16:22
no i can get to login its just i get lots of errors, cant get into KDE, ermm ill try logging in as root.

ill post a message when im in.
Title: /home
Post by: voidmain on 11 November 2002, 16:23
Yes, if your /home is not mounted you must log in as root. You should not have a problem doing this. We can fix it dude. It ain't as hard as you think.
Title: /home
Post by: Doogee on 11 November 2002, 16:26
k im rooting. err i mean im logged on as root. what do i do now commander?
Title: /home
Post by: voidmain on 11 November 2002, 16:28
Paste in a copy of your /etc/fstab so's I can look her over.
Title: /home
Post by: Doogee on 11 November 2002, 16:29
Code: [Select]

Note: i took out the hda7 thing after the problems cosi though it would fix it. my logic i guess  (http://tongue.gif)
Title: /home
Post by: voidmain on 11 November 2002, 16:32
Notice line 4 has a "su" instead of "supermount" (actually the line is screwed up, must have drug your mouse across it, copy line 4 from your earlier post in place of that one that is screwed), there's your first error. Your second problem is you need to create a "/home" directory, then add that "/home" line back into your /etc/fstab. Then mount it. Then look in /home and see what's there (paste in an "ls -l /home" after all that so's I can look it over).

P.S. The "/etc/fstab" is a critical file. You must be very careful when editing this file not to make typos. Check it over 2 or 3 times after making a change and before rebooting after making a change. As long as you don't reboot you can always fix it.

[ November 11, 2002: Message edited by: void main ]

Title: /home
Post by: Doogee on 11 November 2002, 16:38
u ripper, i did the fstab, fixed it up made the home directory, did a "mount /dev/hda7 /home"
i went into the home directory and there was, home, lol, but all is good cos inside /home/home there is /dan  :D  now what do i do to fix up the /home/home business?
Title: /home
Post by: voidmain on 11 November 2002, 16:38
# cd /home/home
# mv * ..
# cd ..
# rmdir home

Done!
Title: /home
Post by: Doogee on 11 November 2002, 16:42
yes! now ill boot into my user account but actually reboot the computer and check it out, them im goin to bed its midnight in 20 mins and i got school tomorrow.

Thanks so much for your help!!!
Title: /home
Post by: voidmain on 11 November 2002, 16:45
No problem. Midnight was 6 hours and 45 minutes ago here and I don't have school tomorrow.

In UNIX it will do exactly what you *tell* it to do, which may not be what you *want* it to do. So it is important that you don't make typos. You made two typos that I can tell that made this a much more difficult exercise than it should have been.

The important part is, do you understand everything that we did? If so good work. It's really not that hard. We just went over a few of the basic things here but are fairly common on all UNIX and UNIX like systems.