LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-16-2009, 05:30 PM   #1
racerong
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Rep: Reputation: 0
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.
 
Old 01-16-2009, 06:17 PM   #2
N3rding
Member
 
Registered: Jan 2009
Distribution: Slackware 12.20
Posts: 49

Rep: Reputation: 17
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
 
Old 01-16-2009, 08:20 PM   #3
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
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
 
Old 01-16-2009, 09:42 PM   #4
racerong
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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
 
Old 01-16-2009, 10:34 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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.
 
Old 01-16-2009, 10:52 PM   #6
racerong
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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.
 
Old 01-16-2009, 10:54 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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.
 
Old 01-16-2009, 11:53 PM   #8
baig
Member
 
Registered: Nov 2008
Location: وادی ھنزہ
Distribution: Solaris 5.10, Debian Server 5.2, CentOS 5.6
Posts: 226
Blog Entries: 3

Rep: Reputation: 38
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!!
 
Old 01-17-2009, 01:26 AM   #9
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by baig View Post
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?
 
Old 01-17-2009, 02:03 AM   #10
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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).

Last edited by btmiller; 01-17-2009 at 02:03 AM. Reason: typo fix
 
Old 01-17-2009, 02:06 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
/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...
 
Old 01-17-2009, 02:26 AM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by chrism01 View Post
/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?
 
Old 01-17-2009, 05:12 AM   #13
baig
Member
 
Registered: Nov 2008
Location: وادی ھنزہ
Distribution: Solaris 5.10, Debian Server 5.2, CentOS 5.6
Posts: 226
Blog Entries: 3

Rep: Reputation: 38
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!!!
 
Old 01-17-2009, 05:15 AM   #14
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Handy to have /home separate for the next upgrade to f11
 
Old 01-17-2009, 05:27 AM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
  


Reply



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
no /usr/tmp otoomet Debian 2 12-13-2005 01:08 PM
mount / , /home , /home/usr on different partitions alekoos Slackware 14 05-03-2004 11:39 AM
Create file using 'touch ./tmp.$$', file tmp.3941 is created, why? huangyanfeng Linux - General 1 04-13-2004 03:36 AM
softlink /usr to /home/usr ??? mlsfit Linux - General 4 11-09-2003 12:16 AM
usr space from /usr for /home ? chanys Linux - Newbie 2 08-26-2003 11:11 PM

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

All times are GMT -5. The time now is 11:39 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
Open Source Consulting | Domain Registration