[SOLVED] Creating a file system in Oracle Enterprise Linux
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
/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...)
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?
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!
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.