Operating System - HP-UX
1754063 Members
2923 Online
108811 Solutions
New Discussion юеВ

Can't create new filesystem in command line mode

 
SOLVED
Go to solution
Chris Fung
Frequent Advisor

Can't create new filesystem in command line mode

Hi,

I got a problem when creating a filesystem in command line mode, however I can accomplish the task in SAM. Just wondering what's wrong with the command line?

Here was my steps:
1. Create a new volume group "vgcreate /dev/vg01 /dev/dsk/c5t10d0"

2. Create a logical volume with 200MB "lvcreate -L 200 /dev/vg01"

3. Extend the filesystem "extendfs -F vxfs /dev/vg01/rlvol1"

Then I encountered an error message "/dev/vg01/rlvol1 invalid super-block"

Can anyone tell me the trick?

Thanks
8 REPLIES 8
Steven Sim Kok Leong
Honored Contributor
Solution

Re: Can't create new filesystem in command line mode

Hi,

After you create the logical volume via lvcreate, you should newfs the LV raw device, not lvextend.

# newfs -F vxfs /dev/vg01/rlvol1

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Uday_S_Ankolekar
Honored Contributor

Re: Can't create new filesystem in command line mode

Hi
Follow these steps

The first step is to create the volume group directory:
# mkdir /dev/vg01

The next step is the creation of the group file inside this directory. This is done with:

# mknod /dev/vg01/group c 64 0x010000

where the minor number 0x010000 refers to the volume group number.

NOTE: The minor number 0xYY0000 of the group file has to be unique to all other group files on the system. This can be checked with:

# ll /dev/*/group

Build the physical volume which should be added to the volume group:

# pvcreate /dev/rdsk/c0t5d0 (Disk name)

To create a physical volume on a disk that may have old LVM information on the disk, use the pvcreate(1M) command with the -f (force) option. Note: All the data on the disk will be lost!

Next step would be a:

# vgcreate /dev/vg01 /dev/dsk/c0t5d0

which, among some other things, updates the /etc/lvmtab for the new configuration.

Though vgcreate leaves the volume group in an active state, it is recommended to do a:

# vgchange -a y vg01
# vgdisplay -v vg01


Now LVcreate
lvcreate [-l le_number | -L lv_size] [-n lv_name] vg_name

For example if you want to create a logical volume lvoldata of size 150 MB in volume group /dev/vg02 so that all physical extents are on /dev/dsk/c1t1d0:

# lvcreate -n lvoldata vg02
# lvextend -L 150 /dev/vg02/lvoldata /dev/dsk/c1t1d0

If you need a filesystem construct it according to

# newfs -F vxfs /dev/vg02/rlvoldata

and mount it at the desired directory

# mount /dev/vg02/lvoldata /mountdirectory



Goodluck,
-USA..



Good Luck..
Michael Tully
Honored Contributor

Re: Can't create new filesystem in command line mode

Hi,

To create a filesystem is quite easy.

Here is an example.

# pvcreate /dev/rdsk/c5t10d0
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgcreate /dev/vg01 /dev/dsk/cxtydz
# lvcreate -n lvol1 /dev/vg01
# lvextend -L 200 /dev/vg01/lvol1
# newfs -F vxfs /dev/vg01/rlvol1
# mkdir /mymountpoint
# mount /dev/vg01/lvol1 /mymountpoint

Make sure you add an entry to /etc/fstab

e.g
/dev/vg01/lvol1 /mymountpoint vxfs rw,suid,delaulog,datainlog 0 2

This is a pretty stright forward one. You will
need to consult the various man pages for
different options for sizes and performance
variants.

HTH
-Michael
Anyone for a Mutiny ?
Sanjay_6
Honored Contributor

Re: Can't create new filesystem in command line mode

Hi Chris,

If you are creating a new logical volume, you have to use newfs command to create a filesystem on the new logical volume. The extendfs command is used to extend the filesystem for an existing logical volume. It is associated with the lvextend command. This is the standard association,

lvcreate and newfs
lvextend and extendfs

use the manual pages for more info.

Hope this helps.

Regds
Ravi_8
Honored Contributor

Re: Can't create new filesystem in command line mode

Hi, chris
pvcraete -f /dev/rdsk/c5t10d0
mkdir /dev/vg01
mknod /dev/vg01/group 64 c 0x010000
vgcreate /dev/vg01 /dev/dsk/c5t10d0
lvcraete -L size(in MB) /dev/vg01
(system returns the lv(x) created (raw))
newfs -F vxfs /dev/vg01/rlvolx
mount /dev/vg01/lvolx /mount_point

make an entry in /etc/fstab

never give up
xujun
Advisor

Re: Can't create new filesystem in command line mode

So distinguish serveral commands:
lvcreate and newfs
lvextend and extendfs

Roger Baptiste
Honored Contributor

Re: Can't create new filesystem in command line mode

Re: Can't create new filesystem in command line mode

Hello

I encountered this problem while I tried to extend a existing volume.

Umount was not possible online (device busy), in single user mode I didn't get access to the disk (don't know why).

So I removed the entry in the /etc/fstab file and rebooted.

Than extendfs encountered the described error message.

What I forgot was to remove some mount entrys in fstab which are located below the volume mountpoint.

I removed all entrys which are mounted below the volume mountpoint and than it succeeded.

Hope it could be helpful for whoever.

Br, Andreas