LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Create a partition for /home (https://www.linuxquestions.org/questions/linux-newbie-8/create-a-partition-for-home-319452/)

FiveFlat 05-02-2005 03:28 PM

Create a partition for /home
 
I want to create a partition solely for the /home directory (and any other partion that you all insist would be a better way than my current configuration)

How do I go about this?

Here is my current configuration:
Code:

# /sbin/fdisk /dev/hda -l

Disk /dev/hda: 20.4 GB, 20491075584 bytes
255 heads, 63 sectors/track, 2491 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1          13      104391  83  Linux
/dev/hda2              14        2394    19125382+  83  Linux
/dev/hda3            2395        2491      779152+  82  Linux swap

Code:

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda2              18G  8.5G  8.6G  50% /
/dev/hda1              99M  6.8M  87M  8% /boot
none                  189M    0  189M  0% /dev/shm


tuxrules 05-02-2005 04:06 PM

You dont seem to have free space left on your hard drive. You either have to resize your partition and make new partitions and then map these new partitions to whichever base directories you want to be on seperate partitions.

Else backup your data and do a clean install.

My configuration is for 80 GB hard drive...yours could be different depending upon size of your drive

partition 1 to 6 are for slack...
hdb1 - /boot 100 MB
hdb2 - / about 10 GB
hdb3 - swap about 1 GB
hdb4 - extended
hdb5 - /home about 40 GB - for all my data
hdb6 - /var about 20 GB - i run a server so to keep it seperate

hdb7 - / for fedora about 8 GB

FiveFlat 05-02-2005 04:57 PM

Okay - then what about this possibility:
I add another physical drive and make that my new /home directory?

If my /home is part of the / (root) partition can I still simply edit the /etc/fstab file to mount /dev/hdb1 /home without any trouble? I found plenty of tutorials on how to move the /home partition - but my secenario is that my /home directory is in my / partition.

tuxrules 05-02-2005 05:06 PM

sure you can add another drive and partition with fdisk. I am sure there are how-to's to move /home parititon to another partition.

FiveFlat 05-02-2005 05:13 PM

That's the thing - I have found plenty of how to's but they reference moving /home as a partition to a new one - not as a directory in the root partition.

jschiwal 05-02-2005 05:40 PM

If you currently are using a /home directory in the / (root) partition, and you want to mount (/home) on another disk, you will need to move everything over from the old /home directory to the new partition, because mounting a partition as /home will cover up the contents of the old directory.

To make things easier, perhaps
A) Log in as root.
B) umount /home
C) mv /home /home-old # This will rename the directory, not move the files.
D) mkdir /home # This is where you will mount the new partition.
# Now both your users' home directories and the new /home partition
# can be accessed at the same time.
D) edit your old fstab file to mount the new drive as /home
E) either copy everything from /home-old to /home or edit the /etc/passwd file and change the home directory entries to 'home-old'.

The location of each user's $HOME directory is listed in the /etc/passwd file. This allows you to distribute users' home directories to different drives. That way you can simply add another drive to make room for new users. It's also possible to use a networked drive as your $HOME. So if you have both a laptop and a desktop, you could create a user on the laptop (with the same user name and user id as the desktop) and use your networked desktop home partition as your $HOME on the laptop.


All times are GMT -5. The time now is 04:15 AM.