LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /home in a different partition (https://www.linuxquestions.org/questions/linux-newbie-8/home-in-a-different-partition-234198/)

s0ftwar3 09-23-2004 04:51 AM

/home in a different partition
 
i heard that is possible to mount my /home directory in a different partition than the root partition, how do i make that?

i made several attempts, like in fstab the mount point of /dev/hda5 in /home, but the only thing that i got there was the paste lost+found.

i would liko to know how the /etc/fstab should be.

thanks!

darksmiley 09-23-2004 05:36 AM

wouldnt you just create a logical or primary partition then mount it on /home? so use cfdisk to add a new partition, then mount it with

mount /dev/hda? /home

, replacing ? with whatever number the partition is. to make a permanent change you would have to edit /etc/fstab, and create a new entry for your new partition (e.g. /dev/hda3 - altho u might prefer to have a logical one) followed by its mounting point in line with the table (/home) then its filesystem and so forth until it looks like the other fstab entries. if you dont know the answer for one of the columns, just copy the settings of your /dev/hda2 partition.

let me know how u do :)

320mb 09-23-2004 05:40 AM

Code:

/dev/hdd6        swap            swap        defaults                      0  0
/dev/hda9        /                ext2        defaults                      1  1
/dev/hda8        /linux          ext2        noauto,owner,users,rw    1  2
/dev/hdb7        /home            ext2        defaults,owner,users,rw        1  2
/dev/hdd7        /var            ext2        defaults                      1  2
/dev/hdd8        /root            ext2        defaults                      1  2
/dev/hda6        /stuff          vfat        noauto,owner,users,rw    1  0
/dev/cdrom      /mnt/cdrom      iso9660    noauto,owner,users,ro    0  0
/dev/sda4        /zip250          auto        noauto,owner,users,rw    0  0
/dev/fd0        /mnt/floppy      auto        noauto,owner,users,rw    0  0
devpts          /dev/pts        devpts      gid=5,mode=620                0  0
proc            /proc            proc        defaults                      0  0

this is one of my LFS boxes.........I have various partitions spread over 3 hard disks..........plus a windows partition.......

bigjohn 09-23-2004 06:55 AM

/dev/hda5 / reiserfs notail 0 0
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda2 /boot ext3 noauto 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda6 /home reiserfs notail 0 0
/dev/hdb /mnt/cdrom auto unhide,umask=0,user,iocharset=iso8859-15,codepage=850,noauto,ro,exec 0 0
/dev/hdc /mnt/cdrom2 auto unhide,umask=0,user,codepage=850,iocharset=iso8859-15,noauto,ro,exec 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=iso8859-15,sync,codepage=850 0 0
/dev/hda1 /mnt/windows ntfs umask=0,nls=iso8859-15,ro 0 0
none /proc proc defaults 0 0
/dev/hda3 swap swap sw 0 0

That's what my fstab looks like. 1 hard drive with windows, /boot, /swap, /root (hda5) and /home(hda6).

The benefit of having a seperate /home (either on the same hdd or a different one) is that if you want to re-install either the same or a different distro, then none of your personal data in /home is lost and provided that you've installed all the same packages (for instance, with me I use opera for browsing, but I alway's have to install that seperatly - after a reinstall of whatever distro, the opera icon in the home partition doesn't work until i've reinstalled the opera as well), then everything works OK.

I did the partitioning under windows with Partition Magic 8 - though there's various ways of doing that within linux.

regards

John

s0ftwar3 09-23-2004 04:18 PM

Ok, i added the line in fstab like

/dev/hda5 ext3 defaults 1 0

everything allright, when i tried to iniciate something that must use X, it tells me it cant iniciate, tells that it cant conect to the server.. thanks for the help give until now.. :)

darksmiley 09-24-2004 07:21 AM

while we're on the subject - what IS the difference between a primary and logical partition? i know u can only have 4 primaries and logicals start at hd?5 - but how do they relate on the disk? thanks :)

michapma 09-24-2004 08:10 AM

Re: Primary vs. Logical partitions

http://www.debian.org/releases/stabl...ioning.en.html

Quote:

6.3 PC Disk Limitations

``Primary'' partitions are the original partitioning scheme for PC disks. However, there can only be four of them. To get past this limitation, ``extended'' and ``logical'' partitions were invented. By setting one of your primary partitions as an extended partition, you can subdivide all the space allocated to that partition into logical partitions. You can create up to 60 logical partitions per extended partition; however, you can only have one extended partition per drive.
There's plenty more info on that topic. :)

You pretty much always need to put the bootable sector of an installation into one of the primary partitions. Furthermore, you need to have a primary partition available in order to create further logical partitions. I don't know whether having the swap partition in a primary partition makes it faster.

s0ftwar3 09-28-2004 09:56 AM

Ok its all fine now, but still, there is a problem, i cant execute nothing from my /home dir, for example enemy territory, when i try to run it, it says: /bin/sh permission denied.

Can someone know how do i fix this? thanks.

darksmiley 09-28-2004 05:50 PM

well done getting it sorted - u probably have to change the permissions for /bin/sh, obviously depending on the user you are using to execute the files. maybe u could open a prompt as root and type in 'chmod 766 /bin/sh' and see if it works.

s0ftwar3 09-29-2004 04:30 AM

hehe i could figure it out by myself (after a lot of attempts)
Nope, its not permissions on /bin/sh.

its in /etc/fstab, the properties of the partition, i left it like /dev/hda5 /home ext3 rw 2 1
and it works fine, thanks you all who answered me ;).


All times are GMT -5. The time now is 11:11 PM.