LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to create /usr /home /tmp (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-usr-home-tmp-697814/)

racerong 01-16-2009 05:30 PM

How to create /usr /home /tmp
 
Hi all,

I just installed cent0s 5 text and no gui. I'm still new to linux and am trying to learn. I want to create the following partition "/usr /home /tmp" but am having a hard time.

When I type $fdisk -l i get the following:
[root@localhost ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 9726 78019672+ 8e Linux LVM
[root@localhost ~]#

And my $df -h is below:
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
71G 1.3G 66G 2% /
/dev/sda1 99M 13M 81M 14% /boot
tmpfs 467M 0 467M 0% /dev/shm
[root@localhost ~]#

Then when I type $fdisk /dev/sda2 to create new partition and press "p" i get the following:
Command (m for help): p

Disk /dev/sda2: 79.8 GB, 79892144640 bytes
255 heads, 63 sectors/track, 9713 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda2p1 1 2433 19543041 83 Linux

Command (m for help): w

However when i try to mount it i get the following:
[root@localhost ~]# mkfs -t ext3 /dev/sda2p1
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda2p1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?
[root@localhost ~]#


Am i missing something? Thanks in advance.

N3rding 01-16-2009 06:17 PM

have you added the device in your fstab? /etc/fstab
eg..

/dev/sda1 /desired/mountpoint filesystemtype noatime 0 0

Be sure to also create the directory folder/s for your desired mountpoint with mkdir

dasy2k1 01-16-2009 08:20 PM

chances are if you have allready got this far the partitioning is allready done....
im not sure what the default arrangement is but if you post the output of mount it will tell you

the ones not on seperate partitians will allready exist as folders

racerong 01-16-2009 09:42 PM

i'm still unable to mkfs, i have edit the /etc/fstab

[root@localhost ~]# mkfs -t ext3 /dev/sda2p1
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda2p1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?

[root@localhost ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

[root@localhost ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sda2p1 /usr ext3 noatime 0 0
[root@localhost ~]#

Also, is that LVM linux taking up all my space (80GB hard drive)?
[root@localhost dev]# fdisk -l

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 9726 78019672+ 8e Linux LVM
[root@localhost dev]#

if so, how do delete that or use it to create space for /usr /home /tmp

Thanks all

billymayday 01-16-2009 10:34 PM

Serious question - do you have any idea what you are doing?

The LVM on sda2 has your installation, so modifying it is a potentially dangerous option.

Where did you get the notation sda2p1 from?

If you really want these as separate partitions (and note the plural, since I assume you actually want each on it's own partition - but since you haven't said why you are doing this, I can't really say), it would be simplest to reinstall an either partition the disk before or during installation.

Another option would be to copy everything off the LVM (you need to do this properly, so ask if you don't know what to do), either shrink the LVM, or probably better, simply delete it and its partition, split the available space into the partitions you want and format them accordingly (probably ext3), and copy the system back onto the "/" (again, you need to do this properly), set up mount points for the new partitions /usr, /local and /home, copy the relevant files back to those directories (again, needs to be done correctly). The you should be right.

Unless you need to, I wouldn't bother if I were you - chances are you will break your system and be reinstalling.

racerong 01-16-2009 10:52 PM

Yes, i want each to be on their own partition if possible.

I like the option to delete the LVM and split the space and format it accordingly. It was a clean install so I do not have anything to backup. Can you show me how to do this?

Thank you much.

billymayday 01-16-2009 10:54 PM

You should be able to simply do a custom partitioning scheme when you get to that stage in the installation process. Make some notes of how much space you want for each ahead of time.

baig 01-16-2009 11:53 PM

Hi,

I am also seeking some advice on how to create some separate partitions for /etc /tmp /var .

On a 80GB HD. What's the best proportion to be allotted to each directory?


Thanks In advance

Cheers!!

billymayday 01-17-2009 01:26 AM

Quote:

Originally Posted by baig (Post 3411658)
Hi,

I am also seeking some advice on how to create some separate partitions for /etc /tmp /var .

On a 80GB HD. What's the best proportion to be allotted to each directory?


Thanks In advance

Cheers!!

Depends what you are doing. I can't see a lot of point in a separate /etc though - why are you doing that?

btmiller 01-17-2009 02:03 AM

In fact, I don't think it's possible to have a separate /etc partition, since init needs /etc/fstab very early on so it knows what other partitions to mount.

There's no hard and fast rule for how partitions should be allocated -- it's dependent on the intended use for the machine. For a general desktop, I tend to think that /, /boot, /home, and swap are sufficient (and with modern BIOSes, even /boot is becoming unnecessary, though I still like to have it).

chrism01 01-17-2009 02:06 AM

/var (where the log files go) can be handy if you get a runaway or overloaded process. The system will still boot and be fixable because '/' isn't full...

billymayday 01-17-2009 02:26 AM

Quote:

Originally Posted by chrism01 (Post 3411737)
/var (where the log files go) can be handy if you get a runaway or overloaded process. The system will still boot and be fixable because '/' isn't full...

Is that true with ext3 and similar? Doesn't the reserved space still allow for booting?

baig 01-17-2009 05:12 AM

Thanks,

Actually I am about to perform an up-gradation from F9 to F10. Therefore I was thinking to have individual partitions for /home /var. I a desktop user. Is this a good idea or should I keep everything under / ?


Cheers!!!

billymayday 01-17-2009 05:15 AM

Handy to have /home separate for the next upgrade to f11

jschiwal 01-17-2009 05:27 AM

If you want separate physical volumes for /usr, /home, and /tmp, you might want to install without lvm. Fedora and Red Hat default to using lvm2. The physical lvm volume can be composed of different physical volumes (drives or partitions). You can have /usr, /home and /tmp in logical volumes. They will have their own filesystems then.
Code:

------    -------------      ----------
pv 1                            lv: /home
------  -->  LVM Volume    --> ----------
pv 2                            lv: /usr
                              ----------
                                lv: /tmp
------    -------------      ----------

The installer has a graphical lvm manager to help you.

If you won't be adding drives later, you might want to forgo the use of lvm altogether. It can be hard to fix problems. If this is a fresh install, it will probably be easiest and quickest to start over.


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