mkfs.btrfs broken

You can report problems, make suggestions, about the new BETA versions in this forum. For stuff related to final releases, please post a message in other forums
Post Reply
Simba7
Posts: 21
Joined: 02 Feb 2008, 21:08
Location: Billings, MT, USA
Contact:

mkfs.btrfs broken

Post by Simba7 » 30 Oct 2011, 05:02

I've been trying to rebuild one of my Gentoo boxes and I'm coming up with this error:

Code: Select all

[email protected] /root % mkfs.btrfs /dev/sda3

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

error checking /dev/sda3 mount status
[email protected] /root %
This is on a freshly partitioned disk using gdisk. Any ideas what's going on?

gernot
Posts: 1131
Joined: 07 Apr 2010, 16:19

Re: mkfs.btrfs broken

Post by gernot » 30 Oct 2011, 08:40

check /proc/partitions whether the kernel scan the new partitiontable.
You can force the rescan with sfdisc -R /dev/sda
The rescan fails if one partition on /dev/sda is mounted.
"dmesg" tells you what the kernel detect.

If /dev/sda3 works well use strace to see what goes wrong.

Gernot

Simba7
Posts: 21
Joined: 02 Feb 2008, 21:08
Location: Billings, MT, USA
Contact:

Re: mkfs.btrfs broken

Post by Simba7 » 31 Oct 2011, 02:49

It was all working fine until I switched to the 3.x kernel.. Then it stopped working.

I'm not sure if it's the kernel or something changed between 2.3.1 and 2.4.0-beta6.

gernot
Posts: 1131
Joined: 07 Apr 2010, 16:19

Re: mkfs.btrfs broken

Post by gernot » 31 Oct 2011, 07:55

please post the last lines of this command as guide to the problem
strace -f mkfs.btrfs /dev/sda3

Gernot

p.s. dont trasch your data on /dev/sda3

Simba7
Posts: 21
Joined: 02 Feb 2008, 21:08
Location: Billings, MT, USA
Contact:

Re: mkfs.btrfs broken

Post by Simba7 » 01 Nov 2011, 01:27

Here ya go.. I do see a possible problem below, though.

Code: Select all

[email protected] /root % strace -f mkfs.btrfs /dev/sda3
execve("/sbin/mkfs.btrfs", ["mkfs.btrfs", "/dev/sda3"], [/* 32 vars */]) = 0
brk(0)                                  = 0x9fcf000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7830000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2/tls/i686/libuuid.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2/tls/i686", 0xbf8790e0) = -1 ENOENT (No such file or directory)
open("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2/tls/libuuid.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2/tls", 0xbf8790e0) = -1 ENOENT (No such file or directory)
open("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2/i686/libuuid.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2/i686", 0xbf8790e0) = -1 ENOENT (No such file or directory)
open("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2/libuuid.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i486-pc-linux-gnu/4.4.2", 0xbf8790e0) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=52110, ...}) = 0
mmap2(NULL, 52110, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7823000
close(3)                                = 0
open("/lib/libuuid.so.1", O_RDONLY)     = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\21\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=13876, ...}) = 0
mmap2(NULL, 16608, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xc74000
mmap2(0xc77000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xc77000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340m\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1327204, ...}) = 0
mmap2(NULL, 1333544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
mmap2(0x250000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x140) = 0x250000
mmap2(0x253000, 10536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x253000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7822000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7822700, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x250000, 8192, PROT_READ)     = 0
mprotect(0xc77000, 4096, PROT_READ)     = 0
mprotect(0x8062000, 4096, PROT_READ)    = 0
mprotect(0x2a8000, 4096, PROT_READ)     = 0
munmap(0xb7823000, 52110)               = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb782f000
write(1, "\n", 1
)                       = 1
write(1, "WARNING! - Btrfs Btrfs v0.19 IS "..., 45WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
) = 45
write(1, "WARNING! - see http://btrfs.wiki"..., 58WARNING! - see http://btrfs.wiki.kernel.org before using

) = 58
open("/dev/sda3", O_RDONLY|O_LARGEFILE) = 3
brk(0)                                  = 0x9fcf000
brk(0x9ff1000)                          = 0x9ff1000
pread64(3, "\20\200\0\0\20\200\1\0\20\200\2\0\20\200\3\0\20\200\4\0\20\200\f\0\20\200\r\0\20\200\30\0"..., 2859, 65536) = 2859
pread64(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2859, 67108864) = 2859
pread64(3, "", 2859, 274877906944)      = 0
brk(0x9ff0000)                          = 0x9ff0000
close(3)                                = 0
open("/proc/mounts", O_RDONLY)          = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb782e000
read(3, "rootfs / rootfs rw 0 0\nudev /dev"..., 1024) = 1024
stat64("rootfs", 0xbf879260)            = -1 ENOENT (No such file or directory)
stat64("udev", 0xbf879260)              = -1 ENOENT (No such file or directory)
stat64("/dev/sdb1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 17), ...}) = 0
stat64("/dev/sda3", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 3), ...}) = 0
stat64("/dev/sdb1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 17), ...}) = 0
lstat64("/dev", {st_mode=S_IFDIR|0755, st_size=3680, ...}) = 0
lstat64("/dev/sda3", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 3), ...}) = 0
lstat64("/dev", {st_mode=S_IFDIR|0755, st_size=3680, ...}) = 0
lstat64("/dev/sdb1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 17), ...}) = 0
stat64("/dev/sda3", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 3), ...}) = 0
stat64("/dev/sdb1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 17), ...}) = 0
stat64("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0
stat64("/dev/sda3", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 3), ...}) = 0
stat64("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0
open("/dev/loop0", O_RDONLY|O_LARGEFILE) = 4
ioctl(4, 0x4c03, 0xbf877204)            = 0
close(4)                                = 0
lstat64("/dev", {st_mode=S_IFDIR|0755, st_size=3680, ...}) = 0
lstat64("/dev/sda3", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 3), ...}) = 0
lstat64("/boot", {st_mode=S_IFDIR|0755, st_size=93, ...}) = 0
lstat64("/boot/sysrcd.dat", 0xbf875118) = -1 ENOENT (No such file or directory)
close(3)                                = 0
munmap(0xb782e000, 4096)                = 0
write(2, "error checking /dev/sda3 mount s"..., 38error checking /dev/sda3 mount status
) = 38
exit_group(1)                           = ?

gernot
Posts: 1131
Joined: 07 Apr 2010, 16:19

Re: mkfs.btrfs broken

Post by gernot » 01 Nov 2011, 07:28

very interesting. Looks like the probe of /boot/sysrcd.dat makes the problem.
I find this link with losetup -a
maybe its a leftover from initrd boot process.
I can fake away this problem with "touch /boot/sysrcd.dat" or "ln -s /livemnt/boot/sysrcd.dat /boot"

maybe we find a good solution.

Gernot

Post Reply