xfs
[Top] [All Lists]

Re: Problems with mkfs.xfs

To: Nathan Scott <nathans@xxxxxxx>
Subject: Re: Problems with mkfs.xfs
From: Detlef Vollmann <dv@xxxxxxxxxxx>
Date: Thu, 09 Aug 2001 21:07:41 +0000
Cc: XFS list <linux-xfs@xxxxxxxxxxx>
Organization: vollmann engineering gmbh
References: <3B71F762.58CD4725@xxxxxxxxxxx> <20010809130928.D260586@xxxxxxxxxxxxxxxxxxxxxxxx> <3B7209C0.1DDDE1DD@xxxxxxxxxxx> <20010809184544.L260586@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
Nathan Scott wrote:
> [btw, another thing I found with the rd driver is you'll need to
> set the blocksize to 512 for XFS - it defaults to 1024, but this
> is configurable]
Unfortunately I can't reboot just from a test shell script :-(

> I looked into this a bit more ... I got that minimum size from
> the man page, so assumed it was right.  Its not.  On IRIX, I'm
> able to create a 4MB filesystem (which is strange because IRIX
> mkfs man page also documents 16MB as the minimum).  To create a
> filesystem this small, you need to use -linternal,size=512b
> (thanks for the tip, Eric).
> 
> Our Linux code goes south when I try to mount a 4MB filesystem
> though - the log recovery code tries to write at a really big
> offset and crashes and burns a bit after doing that.  I'll look
> into this a bit more tomorrow - it seems very strange (broken).

I played a littlebit around with a loopback device (thanks, Steve)
and various sizes.

Here are some results (all on linux-2.4.3):

[root@dwarf tmp]# dd if=/dev/zero of=disk.xfs bs=1024 count=4851
4851+0 records in
4851+0 records out
[root@dwarf tmp]# mkfs -t xfs disk.xfs
meta-data=disk.xfs               isize=256    agcount=1, agsize=4096
blks
data     =                       bsize=4096   blocks=1212, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=0
naming   =version 2              bsize=4096  
log      =internal log           bsize=4096   blocks=1200
realtime =none                   extsz=65536  blocks=0, rtextents=0
Segmentation fault (core dumped)

That core dump is absolutely reproducible, if the size of the file
is big enough for the log (i.e. in the default case >= 4096K) but
the remaining size is less than 13b).

[root@dwarf tmp]# dd if=/dev/zero of=disk.xfs bs=1024 count=4852
4852+0 records in
4852+0 records out
[root@dwarf tmp]# mkfs -t xfs disk.xfs
meta-data=disk.xfs               isize=256    agcount=1, agsize=4096
blks
data     =                       bsize=4096   blocks=1213, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=0
naming   =version 2              bsize=4096  
log      =internal log           bsize=4096   blocks=1200
realtime =none                   extsz=65536  blocks=0, rtextents=0
[root@dwarf tmp]# mount -t xfs -o loop disk.xfs /mount2
[root@dwarf tmp]# df /mount2
Filesystem           1k-blocks      Used Available Use% Mounted on
/var/tmp/disk.xfs           52        32        20  62% /mount2

So, this works fine :-)

[root@dwarf tmp]# umount /mount2
[root@dwarf tmp]# dd if=/dev/zero of=disk.xfs bs=1024 count=2100
2100+0 records in
2100+0 records out
[root@dwarf tmp]# mkfs -t xfs -l internal,size=512b disk.xfs
meta-data=disk.xfs               isize=256    agcount=1, agsize=4096
blks
data     =                       bsize=4096   blocks=525, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=0
naming   =version 2              bsize=4096  
log      =internal log           bsize=4096   blocks=512
realtime =none                   extsz=65536  blocks=0, rtextents=0
[root@dwarf tmp]# mount -t xfs -o loop disk.xfs /mount2
[root@dwarf tmp]# tail -2 /var/log/messages
Aug  9 21:31:42 dwarf kernel: Start mounting filesystem: loop(7,0) 
Aug  9 21:31:42 dwarf kernel: Ending clean XFS mount for filesystem:
loop(7,0) 
[root@dwarf tmp]# df /mount2
Filesystem           1k-blocks      Used Available Use% Mounted on
/var/tmp/disk.xfs           52        32        20  62% /mount2

This was the smallest xfs fs I was able to produce.

Interestingly, if I put the log externally, the data size needs to
be larger than 13b:

[root@dwarf tmp]# umount /mount2
[root@dwarf tmp]# dd if=/dev/zero of=log.xfs bs=1024 count=2048
2048+0 records in
2048+0 records out
[root@dwarf tmp]# dd if=/dev/zero of=disk.xfs bs=1024 count=52
52+0 records in
52+0 records out
[root@dwarf tmp]# mkfs -t xfs -l logdev=log.xfs,size=512b disk.xfs
size 13 of data subvolume is too small, minimum 100 blocks

Strange, as 13 blocks are ok if the log is internal.

[root@dwarf tmp]# dd if=/dev/zero of=disk.xfs bs=1024 count=400
400+0 records in
400+0 records out
[root@dwarf tmp]# mkfs -t xfs -l logdev=log.xfs,size=512b disk.xfs
meta-data=disk.xfs               isize=256    agcount=1, agsize=4096
blks
data     =                       bsize=4096   blocks=100, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=0
naming   =version 2              bsize=4096  
log      =log.xfs                bsize=4096   blocks=512
realtime =none                   extsz=65536  blocks=0, rtextents=0

So far, fine.

[root@dwarf tmp]# mount -t xfs -o loop,logdev=/var/tmp/log.xfs disk.xfs
/mount2
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       or too many mounted file systems
[root@dwarf tmp]# tail -3 /var/log/messages
Aug  9 21:53:45 dwarf kernel: XFS: filesystem is marked as having an
external log; specify logdev on the 
Aug  9 21:53:45 dwarf kernel: mount command line. 
Aug  9 21:53:45 dwarf kernel: XFS: SB validate failed 

The error message in the log is a bit misleading, but in general
it's probably not too surprising not to be able to mount a log
volume from a loopback device -- there is just no option for that.

BTW, using a real block device with the same options works fine:

[root@dwarf tmp]# mkfs -t xfs -l logdev=/dev/hda2,size=512b disk.xfs 
meta-data=disk.xfs               isize=256    agcount=1, agsize=4096
blks
data     =                       bsize=4096   blocks=100, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=0
naming   =version 2              bsize=4096  
log      =/dev/hda2              bsize=4096   blocks=512
realtime =none                   extsz=65536  blocks=0, rtextents=0
[root@dwarf tmp]# mount -t xfs -o loop,logdev=/dev/hda2 disk.xfs /mount2
[root@dwarf tmp]# df /mount2
Filesystem           1k-blocks      Used Available Use% Mounted on
/var/tmp/disk.xfs          400        32       368   8% /mount2
[root@dwarf tmp]# tail -2 /var/log/messages
Aug  9 22:04:08 dwarf kernel: Start mounting filesystem: loop(7,0) 
Aug  9 22:04:08 dwarf kernel: Ending clean XFS mount for filesystem:
loop(7,0) 

cheers,
Detlef

-- 
Detlef Vollmann
vollmann engineering gmbh           Tel: +41-41-4120911
P.O. Box 5106                       Fax: +41-41-4120912
CH-6000 Luzern 5 / Switzerland      eMail: dv@xxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>