Resize2fs fails to resize root partition


13 posts
by Kole » Fri Jan 04, 2013 8:50 am
I'm using Raspbian from 2012-12-16 and I've used the raspi-config to expand the root partition. I can see in fdisk that it has been properly expanded, but resize2fs doesn't want to resize it.

It fails when auto-run during boot and when I try to run it myself, here's what I get:
Code: Select all
pi@raspberrypi / $ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mmcblk0p2 to 1928064 (4k) blocks.
resize2fs: Invalid argument While trying to add group #25


On the previous Raspbian release, the resize worked fine.

Any ideas what I can do on Raspi to fix this?

UPDATE:
WHoops... I forgot to add some data.

Here's what kernel log says at the moment resize2fs runs:
Code: Select all
[23124.124601] EXT4-fs warning (device mmcblk0p2): verify_reserved_gdb:669: reserved GDT 4 missing grp 1 (32772)
[23128.328878] EXT4-fs warning (device mmcblk0p2): verify_reserved_gdb:669: reserved GDT 4 missing grp 1 (32772)
[23143.056075] EXT4-fs warning (device mmcblk0p2): verify_reserved_gdb:669: reserved GDT 4 missing grp 1 (32772)
[23147.122204] EXT4-fs warning (device mmcblk0p2): verify_reserved_gdb:669: reserved GDT 4 missing grp 1 (32772)


Running resize2fs with the debug argument doesn't produce any extra information.

Here's output of strace:
Code: Select all
pi@raspberrypi / $ sudo strace resize2fs /dev/mmcblk0p2
execve("/sbin/resize2fs", ["resize2fs", "/dev/mmcblk0p2"], [/* 15 vars */]) = 0
brk(0)                                  = 0x8df000
uname({sys="Linux", node="raspberrypi", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fa2000
access("/etc/ld.so.preload", R_OK)      = 0
open("/etc/ld.so.preload", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=44, ...}) = 0
mmap2(NULL, 44, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0xb6fa1000
close(3)                                = 0
open("/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\10\4\0\0004\0\0\0"..., 512) = 512
lseek(3, 3456, SEEK_SET)                = 3456
read(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"..., 1240) = 1240
lseek(3, 2537, SEEK_SET)                = 2537
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=7332, ...}) = 0
mmap2(NULL, 35276, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f76000
mprotect(0xb6f77000, 28672, PROT_NONE)  = 0
mmap2(0xb6f7e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0xb6f7e000
close(3)                                = 0
munmap(0xb6fa1000, 44)                  = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=53987, ...}) = 0
mmap2(NULL, 53987, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f68000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libe2p.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\250\25\0\0004\0\0\0"..., 512) = 512
lseek(3, 25932, SEEK_SET)               = 25932
read(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"..., 1040) = 1040
lseek(3, 25640, SEEK_SET)               = 25640
read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49
fstat64(3, {st_mode=S_IFREG|0644, st_size=26972, ...}) = 0
mmap2(NULL, 58908, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f59000
mprotect(0xb6f5f000, 28672, PROT_NONE)  = 0
mmap2(0xb6f66000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5) = 0xb6f66000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libext2fs.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\374\250\0\0004\0\0\0"..., 512) = 512
lseek(3, 227780, SEEK_SET)              = 227780
read(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"..., 1120) = 1120
lseek(3, 227460, SEEK_SET)              = 227460
read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49
fstat64(3, {st_mode=S_IFREG|0644, st_size=228900, ...}) = 0
mmap2(NULL, 260740, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f19000
mprotect(0xb6f50000, 28672, PROT_NONE)  = 0
mmap2(0xb6f57000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x36) = 0xb6f57000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libcom_err.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\234\17\0\0004\0\0\0"..., 512) = 512
lseek(3, 8712, SEEK_SET)                = 8712
read(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"..., 1080) = 1080
lseek(3, 8408, SEEK_SET)                = 8408
read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49
fstat64(3, {st_mode=S_IFREG|0644, st_size=9792, ...}) = 0
mmap2(NULL, 41228, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f0e000
mprotect(0xb6f10000, 28672, PROT_NONE)  = 0
mmap2(0xb6f17000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb6f17000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`\364\0\0004\0\0\0"..., 512) = 512
lseek(3, 130212, SEEK_SET)              = 130212
read(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"..., 1160) = 1160
lseek(3, 129880, SEEK_SET)              = 129880
read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 51) = 51
fstat64(3, {st_mode=S_IFREG|0644, st_size=131372, ...}) = 0
mmap2(NULL, 162704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6ee6000
mprotect(0xb6f06000, 28672, PROT_NONE)  = 0
mmap2(0xb6f0d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f) = 0xb6f0d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\214y\1\0004\0\0\0"..., 512) = 512
lseek(3, 1194784, SEEK_SET)             = 1194784
read(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"..., 1360) = 1360
lseek(3, 1194348, SEEK_SET)             = 1194348
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=1196144, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fa1000
mmap2(NULL, 1238312, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6db7000
mprotect(0xb6ed9000, 28672, PROT_NONE)  = 0
mmap2(0xb6ee0000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x121) = 0xb6ee0000
mmap2(0xb6ee3000, 9512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6ee3000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\274V\0\0004\0\0\0"..., 512) = 512
lseek(3, 82712, SEEK_SET)               = 82712
read(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"..., 1400) = 1400
lseek(3, 82308, SEEK_SET)               = 82308
read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 49) = 49
fstat64(3, {st_mode=S_IFREG|0755, st_size=116462, ...}) = 0
mmap2(NULL, 123412, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6d98000
mprotect(0xb6dac000, 28672, PROT_NONE)  = 0
mmap2(0xb6db3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13) = 0xb6db3000
mmap2(0xb6db5000, 4628, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6db5000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fa0000
set_tls(0xb6fa04c0, 0xb6fa0bb8, 0xb6fa5048, 0xb6fa04c0, 0xb6fa5048) = 0
mprotect(0xb6db3000, 4096, PROT_READ)   = 0
mprotect(0xb6ee0000, 8192, PROT_READ)   = 0
mprotect(0xb6f17000, 4096, PROT_READ)   = 0
mprotect(0xb6f57000, 4096, PROT_READ)   = 0
mprotect(0xb6f66000, 4096, PROT_READ)   = 0
mprotect(0x1a000, 4096, PROT_READ)      = 0
mprotect(0xb6fa4000, 4096, PROT_READ)   = 0
munmap(0xb6f68000, 53987)               = 0
set_tid_address(0xb6fa0068)             = 2895
set_robust_list(0xb6fa0070, 0xc)        = 0
futex(0xbe94a828, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, b6db4000) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0xb6d9d20c, [], SA_SIGINFO|0x4000000}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xb6d9d0b4, [], SA_RESTART|SA_SIGINFO|0x4000000}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3203536, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6b98000
mmap2(NULL, 1179648, PROT_READ, MAP_PRIVATE, 3, 0x1b6) = 0xb6a78000
brk(0)                                  = 0x8df000
brk(0x900000)                           = 0x900000
close(3)                                = 0
write(2, "resize2fs 1.42.5 (29-Jul-2012)\n", 31resize2fs 1.42.5 (29-Jul-2012)
) = 31
stat64("/dev/mmcblk0p2", {st_mode=S_IFBLK|S_ISVTX|0660, st_rdev=makedev(179, 2), ...}) = 0
open("/proc/swaps", 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) = 0xb6a77000
read(3, "Filename\t\t\t\tType\t\tSize\tUsed\tPrio"..., 1024) = 95
stat64("/var/swap", {st_mode=S_IFREG|0600, st_size=104857600, ...}) = 0
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0xb6a77000, 4096)                = 0
open("/proc/mounts", O_RDONLY)          = 3
stat64("/dev/mmcblk0p2", {st_mode=S_IFBLK|S_ISVTX|0660, st_rdev=makedev(179, 2), ...}) = 0
futex(0xb6ee3b94, FUTEX_WAKE_PRIVATE, 2147483647) = 0
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6a77000
read(3, "rootfs / rootfs rw 0 0\n/dev/root"..., 1024) = 711
stat64("/dev/root", {st_mode=S_IFBLK|S_ISVTX|0660, st_rdev=makedev(179, 2), ...}) = 0
stat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/.ismount-test-file", O_RDWR|O_CREAT, 0600) = 4
close(4)                                = 0
unlink("/.ismount-test-file")           = 0
close(3)                                = 0
munmap(0xb6a77000, 4096)                = 0
stat64("/dev/mmcblk0p2", {st_mode=S_IFBLK|S_ISVTX|0660, st_rdev=makedev(179, 2), ...}) = 0
open("/dev/mmcblk0p2", O_RDONLY|O_EXCL) = -1 EBUSY (Device or resource busy)
open("/dev/mmcblk0p2", O_RDWR|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFBLK|S_ISVTX|0660, st_rdev=makedev(179, 2), ...}) = 0
close(3)                                = 0
open("/dev/mmcblk0p2", O_RDONLY|O_LARGEFILE) = 3
stat64("/dev/mmcblk0p2", {st_mode=S_IFBLK|S_ISVTX|0660, st_rdev=makedev(179, 2), ...}) = 0
ioctl(3, BLKDISCARDZEROES, 0xbe94a450)  = 0
lseek(3, 1024, SEEK_SET)                = 1024
read(3, "\0 \3\0\0\200\f\0\342\237\0\0\f\0\0\0}\235\1\0\0\0\0\0\2\0\0\0\2\0\0\0"..., 1024) = 1024
lseek(3, 4096, SEEK_SET)                = 4096
read(3, "q\0\0\0\201\0\0\0\221\0\0\0\0\0\1\0\303\3\4\0\0\0\0\0\0\0\0\0\0\0\206\250"..., 4096) = 4096
open("/dev/mmcblk0p2", O_RDONLY|O_LARGEFILE) = 4
uname({sys="Linux", node="raspberrypi", ...}) = 0
ioctl(4, BLKGETSIZE64, 0xbe94a4a0)      = 0
close(4)                                = 0
open("/usr/share/locale/locale.alias", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6a77000
read(4, "# Locale name alias data base.\n#"..., 4096) = 2570
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0xb6a77000, 4096)                = 0
open("/usr/share/locale/sr_RS/LC_MESSAGES/e2fsprogs.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/sr/LC_MESSAGES/e2fsprogs.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
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) = 0xb6a77000
write(1, "Filesystem at /dev/mmcblk0p2 is "..., 72Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
) = 72
write(1, "old_desc_blocks = 1, new_desc_bl"..., 41old_desc_blocks = 1, new_desc_blocks = 1
) = 41
open("/", O_RDONLY)                     = 4
ioctl(4, 0x40086610, 0xbe94a708)        = -1 EINVAL (Invalid argument)
ioctl(4, 0x40046607, 0xbe94a624)        = 0
gettimeofday({1357289798, 596886}, NULL) = 0
brk(0x925000)                           = 0x925000
gettimeofday({1357289798, 602284}, NULL) = 0
lseek(3, 462848, SEEK_SET)              = 462848
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 528384, SEEK_SET)              = 528384
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 466944, SEEK_SET)              = 466944
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 532480, SEEK_SET)              = 532480
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 471040, SEEK_SET)              = 471040
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 536576, SEEK_SET)              = 536576
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 475136, SEEK_SET)              = 475136
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 540672, SEEK_SET)              = 540672
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 479232, SEEK_SET)              = 479232
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 544768, SEEK_SET)              = 544768
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 483328, SEEK_SET)              = 483328
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 548864, SEEK_SET)              = 548864
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 487424, SEEK_SET)              = 487424
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 552960, SEEK_SET)              = 552960
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 491520, SEEK_SET)              = 491520
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 557056, SEEK_SET)              = 557056
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 495616, SEEK_SET)              = 495616
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 561152, SEEK_SET)              = 561152
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 499712, SEEK_SET)              = 499712
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 565248, SEEK_SET)              = 565248
read(3, "\377\377\377\377\377\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 503808, SEEK_SET)              = 503808
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 569344, SEEK_SET)              = 569344
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 507904, SEEK_SET)              = 507904
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 573440, SEEK_SET)              = 573440
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 512000, SEEK_SET)              = 512000
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 516096, SEEK_SET)              = 516096
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 1879048192, SEEK_SET)          = 1879048192
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 1879052288, SEEK_SET)          = 1879052288
read(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"..., 4096) = 4096
lseek(3, 2013265920, SEEK_SET)          = 2013265920
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
lseek(3, 2013270016, SEEK_SET)          = 2013270016
read(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"..., 4096) = 4096
_llseek(3, 2147483648, [2147483648], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2147487744, [2147487744], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2281701376, [2281701376], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2281705472, [2281705472], SEEK_SET) = 0
read(3, "\377\377\377\377\377\t\0\0@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\210\f\200"..., 4096) = 4096
_llseek(3, 2415919104, [2415919104], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2415923200, [2415923200], SEEK_SET) = 0
read(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"..., 4096) = 4096
_llseek(3, 2550136832, [2550136832], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2550140928, [2550140928], SEEK_SET) = 0
read(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"..., 4096) = 4096
_llseek(3, 2684354560, [2684354560], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2684358656, [2684358656], SEEK_SET) = 0
read(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"..., 4096) = 4096
_llseek(3, 2818572288, [2818572288], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2818576384, [2818576384], SEEK_SET) = 0
read(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"..., 4096) = 4096
_llseek(3, 2952790016, [2952790016], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 2952794112, [2952794112], SEEK_SET) = 0
read(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"..., 4096) = 4096
_llseek(3, 3087007744, [3087007744], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 3087011840, [3087011840], SEEK_SET) = 0
read(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"..., 4096) = 4096
_llseek(3, 3221225472, [3221225472], SEEK_SET) = 0
read(3, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"..., 4096) = 4096
_llseek(3, 3221229568, [3221229568], SEEK_SET) = 0
read(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"..., 4096) = 4096
gettimeofday({1357289798, 820967}, NULL) = 0
gettimeofday({1357289798, 822662}, NULL) = 0
brk(0x94c000)                           = 0x94c000
mmap2(NULL, 245760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6a3b000
write(1, "Performing an on-line resize of "..., 71Performing an on-line resize of /dev/mmcblk0p2 to 1928064 (4k) blocks.
) = 71
ioctl(4, 0x40046607, 0xbe94a624)        = 0
ioctl(4, 0x40186608, 0xbe94a608)        = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(4, 0x40286608, 0xbe94a5e0)        = -1 EINVAL (Invalid argument)
write(2, "resize2fs", 9resize2fs)                = 9
write(2, ": ", 2: )                       = 2
open("/usr/share/locale/sr_RS/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/sr/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "Invalid argument", 16Invalid argument)        = 16
write(2, " ", 1 )                        = 1
write(2, "While trying to add group #25", 29While trying to add group #25) = 29
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "\n", 1
)                       = 1
exit_group(1)                           = ?
Posts: 29
Joined: Fri Nov 23, 2012 9:19 pm
Location: Belgrade, Serbia
by malakai » Fri Jan 04, 2013 9:23 am
First you need to change the partition table with fdisk. You need to remove the existing partition entries and then create a single new partition than takes the whole free space of the disk. This will only change the partition table, not the partitions data on disk. The start of the new partition needs to be aligned with the old partition!

Start fdisk:

sudo fdisk -cu /dev/mmcblk0

Then delete partitions with d and create a new with n. You can view the existing table with p.

p to see the current start of the main partition
d, 3 to delete the swap partition
d, 2 to delete the main partition
n p 2 to create a new primary partition, next you need to enter the start of the old main partition and then the size (enter for complete SD card). The main partition on the Debian image from 2012-04-19 starts at 157696, but the start of your partition might be different. Check the p output!
w write the new partition table

Now you need to reboot:

sudo shutdown -r now

After the reboot you need to resize the filesystem on the partition. The resize2fs command will resize your filesystem to the new size from the changed partition table.

sudo resize2fs /dev/mmcblk0p2

This will take a few minutes, depending on the size and speed of your SD card.

When it is done, you can check the new size with:

df -h


http://elinux.org/RPi_Resize_Flash_Partitions

Most likely it just hung during reboot I think the December image only contains the Pi Store and no changes to the OS at least none that should affect something like this.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by Kole » Fri Jan 04, 2013 2:55 pm
Thanks for the answer and sorry if I may sound a bit aggressive but I have to ask: Did you even read the post itself in detail and not just title? The response gives appearance of a canned response and doesn't address my issue, except in the last line. I'm aware that another user here had similar symptoms which are believed to be caused by shutdown during resize operation.

As I said, the boot and root partitions exist in fdisk and resize2fs always fails.
In fact here's output of fdisk's print command:
Code: Select all
root@raspberrypi:/# fdisk /dev/mmcblk0

Command (m for help): p

Disk /dev/mmcblk0: 7960 MB, 7960264704 bytes
4 heads, 16 sectors/track, 242928 cylinders, total 15547392 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00017b69

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880    15547391     7712256   83  Linux

Command (m for help): q

It looks fine to me.

What I didn't mention in the original post, but should have in retrospective, is that it failed first time too with explicit failure report on screen during boot (which I can't seem to find in logs, maybe it happens before system log starts?) and that it fails after a second or so. It's run at every boot and every time it fails.


Also I know that I can just format the whole card and re-image it, but I just moved into it and would like to avoid setting up everything again.

Also if it matters, the card itself is Kingston SD10G2/8GB SDHC Card – Class 10 100x
Posts: 29
Joined: Fri Nov 23, 2012 9:19 pm
Location: Belgrade, Serbia
by jojopi » Fri Jan 04, 2013 3:10 pm
I take it there are no logs about SD or MMC errors talking to the card?

Try forcing a filesystem consistency check, to repair any irregularities from previous aborted attempts:
Code: Select all
sudo touch /forcefsck
sudo reboot
And reboot once more if necessary.
User avatar
Posts: 1873
Joined: Tue Oct 11, 2011 8:38 pm
by Kole » Fri Jan 04, 2013 3:40 pm
No, only logs are the ones I posted. I'm rebooting now and I'll report once fsck finishes.

UPDATE: I'm in maintenance mode now and during fsck (automatic failed complaining of unexpected errors, so I'm running it manually now), I started to get I/O errors related to the card and interrupt timeouts while waiting for the card. Probably an SD card issue?
Posts: 29
Joined: Fri Nov 23, 2012 9:19 pm
Location: Belgrade, Serbia
by rurwin » Fri Jan 04, 2013 4:36 pm
I wonder if this is a rebadged card. There are instances where small cards have been labelled as larger ones. In some cases even the firmware on the card thinks the size is larger than it is. Such cards have found their way to reputable dealers, and Kingston is one of the more popular manufacturers to be targeted.
User avatar
Moderator
Moderator
Posts: 2890
Joined: Mon Jan 09, 2012 3:16 pm
by Kole » Fri Jan 04, 2013 4:48 pm
This is what I fear too.

My previous Raspbian installation died when I tried to install Banshee. I remember that it pulled large amount of dependencies. At one moment, Synaptic froze and root partition couldn't be read. At that time, I was using new firmware from rpi-update and had the computer overclocked to 800 MHz, so I wrote that off as overclocking-induced problem and installed currently newest version of Raspbian and gave up on overclocking for the foreseeable future. I remember that at the time, I had around 3 GiB filled. I can't expand beyond that size right now too.

I'll dig around the data SD card's firmware reports and see what I can see. Fortunately, that's at least easy in GNU/Linux.

Reports of ghost shift and rebadged cards often mention unusual serial numbers and strange week/year codes on the cards.
Posts: 29
Joined: Fri Nov 23, 2012 9:19 pm
Location: Belgrade, Serbia
by Kole » Sat Jan 05, 2013 1:15 am
I did some troubleshooting on the card and my conclusion is that the card is probably from one of the Kingston's low-quality product series, so that could be related to my problems.

Some time ago I read this blog post: http://www.bunniestudios.com/blog/?page_id=1022. A number of SD cards were obtained from Kingston's official distributor and have misbehaved. Author did some research on Kingston's manufacturing practices and after presenting results to Kingston, they replaced the cards.

It seems that both his problematic cards and my card have same manufacturer ID of 0x000041 and same oemid of 0x3432. Also the name format looks similar to format of problematic cards. On my card it's SD8GB and on his 2 GB cards, it' SD2GB. Several other internet sources claim that normally-operating Kingston SD cards have names using SA08G or SD08G naming patterns, but on the other hand those exact names are already in use by class 4 cards.

Unlike in the linked blog post, date value on my card is 04/2012 which looks acceptable to me. I'm not sure about the serial number. It's value is 0x00d80289 or 14 156 425 in decimal. The number isn't too low, but I wouldn't have been surprised if it was much higher.

So normally, I'd conclude that the card is broken and get another one. Just to be sure, I formatted the card with SDFormat and then used win32diskimager to write Raspbian version 2012-10-28. After it started, I immediately resized the partition and it resized fine (or so it seemed)!

So to be sure that everything works fine, I did fsck and I got errors in thousands of inodes. Several minutes of holding Y button down, fsck finished and I've rebooted the computer. I've run fsck one more time and now it doesn't find any errors.

So I formatted the SD card again using the SDFormat and have written Raspbian 2012-12-16 on it and again I get the problems with resize2fs.

Finally I moved back to version 2012-10-28 and it seems to be working fine so far. Next, I'll try to copy some large files on the partition and see how it handles that.
Posts: 29
Joined: Fri Nov 23, 2012 9:19 pm
Location: Belgrade, Serbia
by SebC » Fri Jan 18, 2013 1:04 pm
Hi, I'm having the same problem with the same SD Card (Kingston 8GB Class 10 100x).
The problem first occurs when I was installing some package and thus having more than about 3GB of data on the rootfs partition ; At this time, I was running on an "old" raspbian.
Since I put the latest, I was unable to do a resize2fs just like you.

About card information, I have the same manfid/oemid (0x000041 and 0x3432), a classic date (11/2012 for a card purchased on 12/2012) but I have a smaller serial than you (0x005001f6)!

Were you able to run correctly the Pi with the card and a previous Raspbian release? I'll try to get my SD card changed from Kingston (through the retailler where I bought it) but I'm affraid that they won't change it if I'm not able to prove the problem clearly...
Posts: 2
Joined: Fri Jan 18, 2013 12:56 pm
Location: Lyon - France
by Kole » Fri Jan 18, 2013 5:30 pm
First I used the SD Formatter from https://www.sdcard.org/downloads/formatter_3/ to format the card before imaging. I don't know if this helped or not, but I'll leave it as a step just in case it did something.

After that I burned the 2012-10-28 image of Raspbian and resized the root partition. Then I installed rpi-update and got newest firmware and kernel.

After that, I've run
Code: Select all
sudo touch /forcefsck
sudo reboot
. I got many errors and used yes on each to fix it.

Since then card seems to be working fine and I haven't had any problems. I did manage to almost completely fill it (left couple of megs free), read the files from it and then delete the files. On each step I run fsck and it didn't find anything wrong. So it seems to be working fine at the moment. Right now, 3.2 GiB are used on the card.
Posts: 29
Joined: Fri Nov 23, 2012 9:19 pm
Location: Belgrade, Serbia
by SebC » Fri Jan 18, 2013 10:49 pm
Thanks for the answer, I'll try it to see if it works with me as well.
Posts: 2
Joined: Fri Jan 18, 2013 12:56 pm
Location: Lyon - France
by andrum99 » Fri Jan 18, 2013 11:43 pm
Kole wrote:After that, I've run
Code: Select all
sudo touch /forcefsck
sudo reboot
. I got many errors and used yes on each to fix it.


I have added a line to my /etc/rc.local to force a check of the root filesystem on every boot as I used to have big problems with random corruption. The line looks like this:

Code: Select all
/usr/bin/touch /forcefsck

and should be added just above the line that reads 'exit 0'. The pi takes longer to boot but it is handy to know that I can check the root filesystem any time I want just be rebooting the Pi.

Cheers

Andrew.
My blog, with lots of Raspberry Pi goodness: andrum99.blogspot.co.uk
Posts: 209
Joined: Fri Jul 20, 2012 2:41 pm
by jojopi » Sat Jan 19, 2013 1:14 am
andrum99 wrote:and should be added just above the line that reads 'exit 0'.
/etc/rc.local runs after fsck, so this has the odd property of only starting to work two reboots after you add it. The normal way to force an fsck on each boot is to add "forcefsck" to /boot/cmdline.txt.

Also, though regular fsck may be useful for detecting filesystem corruption problems, it is not a fix. It will try to make the file structure consistent, but it will not be able to recover damaged file contents. If your system is suffering random corruption on an ongoing basis, then sooner or later it will stop working.
User avatar
Posts: 1873
Joined: Tue Oct 11, 2011 8:38 pm