LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-29-2014, 06:38 AM   #1
oel
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Rep: Reputation: Disabled
Creating a file system in Oracle Enterprise Linux


Hello,

I need to create a filesystem in a Oracle Enterprise Linux.
I have a Volumegroup and Logicvolume created.

I´m trying:

# mkfs /dev/sdb
mke2fs 1.43-WIP (20-Jun-2013)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
/dev/sdb is apparently in use by the system; will not make a filesystem here!


Could you lead me in the process?

Regards and thank you in advanced!
 
Old 04-29-2014, 06:49 AM   #2
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Rep: Reputation: Disabled
Firstly the error message tells you that /dev/sdb isn't a partition, it's a whole device and it's usually a second hard drive or a flash drive since /dev/sda is typically going to be the first hard drive. you can still format the whole device if you want but you'll usually want to partition it. The first partition is going to be /dev/sdb1 for example and the second partition will be /dev/sdb2. You'll need to read up on partitions to learn about the limits of primary and extended partitions.

Secondly, you said you have a volume group and a logical volume created. Neither /dev/sdb or /dev/sda are logical volumes. Those are regular block devices. You can view your logical volumes with
Code:
lvdisplay
or
Code:
 lvm lvdisplay
and it will show you the full path to the logical volume that you want to format. You can also find it in the /dev/mapper directory.

All of this only applies if you actually did create an lvm properly.

http://www.thegeekstuff.com/2010/08/how-to-create-lvm/

Last edited by wstewart90; 04-29-2014 at 06:50 AM.
 
1 members found this post helpful.
Old 04-29-2014, 07:01 AM   #3
oel
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hi wstewart90,

I started with your link...

# sudo pvcreate /dev/sdb
Device /dev/sdb not found (or ignored by filtering).
# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb /dev/sdb1

What diference exists between /dev/sdb and /dev/sdb1?

Regards
 
Old 04-29-2014, 07:09 AM   #4
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Rep: Reputation: Disabled
/dev/sdb is the entire block device(an entire hard drive for instance). /dev/sdb1 is a partition on that hard drive. you can have multiple partions on /dev/sdb that will all be numbered (e.g., sdb1, sdb2, sdb3 etc...)

http://www.pcworld.com/article/18594...ard_drive.html


partitioning a hard drive ^^^

Last edited by wstewart90; 04-29-2014 at 07:12 AM.
 
1 members found this post helpful.
Old 04-29-2014, 07:34 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
There is a GUI tool called system-config-lvm that might be easier for you to understand then using command line utilities.
Do you want to extend your existing VG and LV?

You might want to look at this URL which links to the Redhat LVM guide.
http://www.oracle-base.com/articles/...management.php
 
1 members found this post helpful.
Old 04-29-2014, 08:56 AM   #6
oel
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hi,
after the first instructions of the link, I have this result...

# pvcreate /dev/sdb1
Can't open /dev/sdb1 exclusively. Mounted filesystem?

I´ve tryed too:

#pvcreate /dev/sdb
Can't open /dev/sdb exclusively. Mounted filesystem?
#pvremove /dev/sdb
No physical volume label read from /dev/sdb
Physical Volume /dev/sdb not found


Here I post the first instruction:

Thank you in advanced!


# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): c
DOS Compatibility flag is not set

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): n
Command action
e extended
p primary partition (1-4)
1
Invalid partition number for type `1'
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
Partition 1 is already defined. Delete it before re-adding it.

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): d
Selected partition 1

Command (m for help):
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +20G
Value out of range.
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +19G

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First sector (39847936-41943039, default 39847936):
Using default value 39847936
Last sector, +sectors or +size{K,M,G} (39847936-41943039, default 41943039):
Using default value 41943039

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002f74e

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2611 20458496 8e Linux LVM

Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x34cf36d2

Device Boot Start End Blocks Id System
/dev/sdb1 1 2481 19922944 8e Linux LVM
Partition 1 does not end on cylinder boundary.
/dev/sdb2 2481 2611 1047552 8e Linux LVM
Partition 2 does not end on cylinder boundary.

Disk /dev/mapper/vg_sav500760072-lv_root: 16.8 GB, 16785604608 bytes
255 heads, 63 sectors/track, 2040 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_sav500760072-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_oracle-oraclelv: 20.4 GB, 20401094656 bytes
255 heads, 63 sectors/track, 2480 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

# pvcreate /dev/sdb1
Can't open /dev/sdb1 exclusively. Mounted filesystem?
#

Last edited by oel; 04-29-2014 at 09:17 AM.
 
Old 04-29-2014, 09:58 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Post the output of the mount command (without any options)
 
Old 04-29-2014, 10:48 AM   #8
oel
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hi Michael, finally I could create and mount the filesystem...

I follow all the steps in your link and everything ok. The command used was: "mount -t ext4 -o rw /dev/vgoracle/lvol0 /datos11"

Then, problem solved, thank you!!!

But I have a last question... What diference exists between mount the filesystem in /dev/vgoracle/lvol0 or /dev/sdb1?

Regards,
María
 
Old 04-29-2014, 10:55 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
With LVM /dev/sdb1 is the physical device i.e a container for your volume groups and logical volumes. So you would create and mount the filesysem i.e /dev/vgoracle/lvol0.

If you are not using LVM then /dev/sdb1 is a regular partition and you would create a filesystem and mount just /dev/sdb1.
 
1 members found this post helpful.
Old 04-29-2014, 10:57 AM   #10
oel
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you for the explanation! We can close the thread because my problem is now solved.
 
Old 04-29-2014, 11:12 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
You can mark the thread as solved using the thread tools menu at the top of the page.
 
1 members found this post helpful.
  


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
Oracle Enterprise Linux 5.x will not install on VM due to missing file linux-amateur Linux - General 3 11-21-2010 12:18 PM
installing oracle 10g in Suse Linux Enterprise Edition 10.1 operating system naveenmatt Linux - Newbie 1 08-06-2008 10:14 AM
vgscan produces no output using file descriptors on Oracle Enterprise Linux. sandiworld Linux - Enterprise 1 03-27-2008 06:04 AM
LXer: Automated System Lock Down Tool for Oracle Enterprise Linux LXer Syndicated Linux News 0 03-26-2008 10:40 AM

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

All times are GMT -5. The time now is 03:14 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