Re: ext2fs 2GiB file size limit

2010-12-10 Thread frantisek holop
hmm, on Wed, Dec 08, 2010 at 12:47:06PM +0100, Peter J. Philipp said that
  -O filesystem-format
  Select the filesystem-format.
 
0`GOOD_OLD_REV'; this option is primarily used to
 build root file systems that can be understood by
 old or dumb firmwares for bootstrap.  (default)
1`DYNAMIC_REV'; various extended (and sometimes
 incompatible) features are enabled (though not all
 features are supported on OpenBSD).  Currently
 only the following features are supported:
 ...some cut...
   LARGEFILEEnable files larger than 2G
bytes.

you left out the interesting bit :]

if (fs-e2fs.e2fs_rev = E2FS_REV0) {
/* Linux automagically upgrades to REV1 here! */
return (EFBIG);
}

there was a funny chicken-egg problem with this.
the e2fsprogs' mkfs.ext2 does not set 'large_file'
by default either, but as the linux kernel automagically
upgrades to REV1 whenever a process tries to write a bigger
file for the first time, it is not really a problem.

but naturally, people with linux background trying to use
ext2fs on different systems get to know about this flag after
lot of hair pulling.

i have asked Theodore in the past to enable this feature
by default, but looks like it never happened.

i think it could save a lot of time and sanity if the
openbsd kernel emitted a dmesg when someone tries
to write a bigger file..

Index: ext2fs_inode.c
===
RCS file: /cvs/src/sys/ufs/ext2fs/ext2fs_inode.c,v
retrieving revision 1.43
diff -u -r1.43 ext2fs_inode.c
--- ext2fs_inode.c  23 Nov 2008 23:52:35 -  1.43
+++ ext2fs_inode.c  10 Dec 2010 16:09:33 -
@@ -83,6 +83,8 @@

 if (fs-e2fs.e2fs_rev = E2FS_REV0) {
 /* Linux automagically upgrades to REV1 here! 
*/
+   log(LOG_NOTICE,
+   ext2fs revision does not support large 
files\n);
 return (EFBIG);
 }
 if (!(fs-e2fs.e2fs_features_rocompat

-f
-- 
life is lived forwards, but understood backwards.



ext2fs 2GiB file size limit

2010-12-08 Thread LEVAI Daniel
Hi!


I'm having this issue with an ext2fs filesystem on an external USB
drive.
I've created the partition/disklabel/filesystem with OpenBSD tools, and
after mounting, and dd'ing /dev/zero onto the fs, it bails out at 2GiB:

$ dd if=/dev/zero of=/mnt/hotplug/sd3i_FUJITSU/Downloads/testfile bs=4096
dd: /mnt/hotplug/sd3i_FUJITSU/Downloads/testfile: File too large
524288+0 records in
524287+0 records out
2147479552 bytes transferred in 399.042 secs (5381579 bytes/sec)


I don't remember having a 2GiB filesize limit anywhere near, but the old
extfs. What am I missing here?


Thanks,
Daniel

-- 
LIVAI Daniel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F



Re: ext2fs 2GiB file size limit

2010-12-08 Thread Guillaume Dualé
On Wed, 8 Dec 2010 09:23:49 +0100, LEVAI Daniel l...@ecentrum.hu
wrote:
 Hi!
Hi,
 
 
 I'm having this issue with an ext2fs filesystem on an external USB
 drive.
 I've created the partition/disklabel/filesystem with OpenBSD tools, and
 after mounting, and dd'ing /dev/zero onto the fs, it bails out at 2GiB:
 
 $ dd if=/dev/zero of=/mnt/hotplug/sd3i_FUJITSU/Downloads/testfile bs=4096
 dd: /mnt/hotplug/sd3i_FUJITSU/Downloads/testfile: File too large
 524288+0 records in
 524287+0 records out
 2147479552 bytes transferred in 399.042 secs (5381579 bytes/sec)
 
 
 I don't remember having a 2GiB filesize limit anywhere near, but the old
 extfs. What am I missing here?
http://en.wikipedia.org/wiki/Ext2
 Max file size  16 GB - 2 TB

So, check if your partition is really in ext2 and the size of this
partition.
And what is the physical size of your external drive ? :)

Guillaume.
 
 
 Thanks,
 Daniel



Re: ext2fs 2GiB file size limit

2010-12-08 Thread LEVAI Daniel
On Wed, Dec 08, 2010 at 09:35:34 +0100, Guillaume Duali wrote:
 On Wed, 8 Dec 2010 09:23:49 +0100, LEVAI Daniel l...@ecentrum.hu wrote:
  I'm having this issue with an ext2fs filesystem on an external USB
  drive.
  I've created the partition/disklabel/filesystem with OpenBSD tools, and
  after mounting, and dd'ing /dev/zero onto the fs, it bails out at 2GiB:
  
  $ dd if=/dev/zero of=/mnt/hotplug/sd3i_FUJITSU/Downloads/testfile bs=4096
  dd: /mnt/hotplug/sd3i_FUJITSU/Downloads/testfile: File too large
  524288+0 records in
  524287+0 records out
  2147479552 bytes transferred in 399.042 secs (5381579 bytes/sec)
[...]
 So, check if your partition is really in ext2 and the size of this
 partition.
 And what is the physical size of your external drive ? :)

$ mount
/dev/sd3i on /mnt/hotplug/sd3i_FUJITSU type ext2fs (local, nodev, noexec, 
nosuid)


$ df -h
/dev/sd3i 73.3G   26.4G   46.9G36%/mnt/hotplug/sd3i_FUJITSU


$ fdisk sd3
Disk: sd3   geometry: 9729/255/63 [156301488 Sectors]
Offset: 0   Signature: 0xAA55
Starting Ending LBA Info:
 #: id  C   H   S -  C   H   S [   start:size ]
---
 0: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
 1: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
 2: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
*3: A6  0   1   1 -   9728 254  63 [  63:   156296322 ] OpenBSD


$ disklabel sd3
# /dev/rsd3c:
type: SCSI
disk: SCSI disk
label: FUJITSU MHV2080B
duid: b122005bf43a432c
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 9729
total sectors: 156301488
boundstart: 63
boundend: 156296385
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
  c:1563014880  unused
  i:156296321   63  ext2fs


dmesg sd3 part:
umass1 at uhub0 port 1 configuration 1 interface 0 Initio MHV2080BH rev 
2.00/3.01 addr 5
umass1: using SCSI over Bulk-Only
scsibus5 at umass1: 2 targets, initiator 0
sd3 at scsibus5 targ 1 lun 0: Initio, MHV2080BH, 3.01 SCSI0 0/direct fixed
sd3: 76319MB, 512 bytes/sec, 156301488 sec total



dmesg:
OpenBSD 4.8-current (GENERIC.MP) #545: Mon Dec  6 16:24:15 MST 2010
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Genuine Intel(R) CPU T2400 @ 1.83GHz (GenuineIntel 686-class) 1.83 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
real mem  = 2145808384 (2046MB)
avail mem = 2100625408 (2003MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 08/27/09, BIOS32 rev. 0 @ 0xfd6b0, SMBIOS 
rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version 79ETE5WW (2.25 ) date 08/27/2009
bios0: LENOVO 2007FRG
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET BOOT SSDT SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) LURT(S3) DURT(S3) EXP0(S4) EXP1(S4) 
EXP2(S4) EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3) USB7(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 166MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Genuine Intel(R) CPU T2400 @ 1.83GHz (GenuineIntel 686-class) 1.83 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus 4 (EXP2)
acpiprt5 at acpi0: bus 12 (EXP3)
acpiprt6 at acpi0: bus 21 (PCI1)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS
acpitz0 at acpi0: critical temperature 127 degC
acpitz1 at acpi0: critical temperature 99 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model 92P1127 serial 23233 type LION oem SANYO
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
bios0: ROM list: 0xc/0xfe00 0xd/0x1000 0xd1000/0x1000 0xdc000/0x4000! 
0xe/0x1!
cpu0: Enhanced SpeedStep 1829 MHz: speeds: 1833, 1333, 1000 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 Intel 82945GM Host rev 0x03
ppb0 at pci0 dev 1 function 0 Intel 82945GM PCIE rev 0x03: apic 1 int 16 (irq 
11)
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 ATI Radeon Mobility X1400 rev 0x00
wsdisplay0 at vga1 mux 1: console 

Re: ext2fs 2GiB file size limit

2010-12-08 Thread Guillaume Dualé
On Wed, 8 Dec 2010 09:59:42 +0100, LEVAI Daniel l...@ecentrum.hu
wrote:
 On Wed, Dec 08, 2010 at 09:35:34 +0100, Guillaume DualC) wrote:
 On Wed, 8 Dec 2010 09:23:49 +0100, LEVAI Daniel l...@ecentrum.hu wrote:
  I'm having this issue with an ext2fs filesystem on an external USB
  drive.
  I've created the partition/disklabel/filesystem with OpenBSD tools, and
  after mounting, and dd'ing /dev/zero onto the fs, it bails out at 2GiB:
 
  $ dd if=/dev/zero of=/mnt/hotplug/sd3i_FUJITSU/Downloads/testfile bs=4096
  dd: /mnt/hotplug/sd3i_FUJITSU/Downloads/testfile: File too large
  524288+0 records in
  524287+0 records out
  2147479552 bytes transferred in 399.042 secs (5381579 bytes/sec)
 [...]
 So, check if your partition is really in ext2 and the size of this
 partition.
 And what is the physical size of your external drive ? :)
 
 $ mount
 /dev/sd3i on /mnt/hotplug/sd3i_FUJITSU type ext2fs (local, nodev,
 noexec, nosuid)
 
 
 $ df -h
 /dev/sd3i 73.3G   26.4G   46.9G36%/mnt/hotplug/sd3i_FUJITSU
 
 
 $ fdisk sd3
 Disk: sd3   geometry: 9729/255/63 [156301488 Sectors]
 Offset: 0   Signature: 0xAA55
 Starting Ending LBA Info:
  #: id  C   H   S -  C   H   S [   start:size ]
 ---
  0: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
  1: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
  2: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
 *3: A6  0   1   1 -   9728 254  63 [  63:   156296322 ] OpenBSD
 
 
 $ disklabel sd3
 # /dev/rsd3c:
 type: SCSI
 disk: SCSI disk
 label: FUJITSU MHV2080B
 duid: b122005bf43a432c
 flags:
 bytes/sector: 512
 sectors/track: 63
 tracks/cylinder: 255
 sectors/cylinder: 16065
 cylinders: 9729
 total sectors: 156301488
 boundstart: 63
 boundend: 156296385
 drivedata: 0
 
 16 partitions:
 #size   offset  fstype [fsize bsize  cpg]
   c:1563014880  unused
   i:156296321   63  ext2fs
 
 
 dmesg sd3 part:
 umass1 at uhub0 port 1 configuration 1 interface 0 Initio MHV2080BH
 rev 2.00/3.01 addr 5
 umass1: using SCSI over Bulk-Only
 scsibus5 at umass1: 2 targets, initiator 0
 sd3 at scsibus5 targ 1 lun 0: Initio, MHV2080BH, 3.01 SCSI0 0/direct fixed
 sd3: 76319MB, 512 bytes/sec, 156301488 sec total
 
 
 
 dmesg:
 OpenBSD 4.8-current (GENERIC.MP) #545: Mon Dec  6 16:24:15 MST 2010
 dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
 cpu0: Genuine Intel(R) CPU T2400 @ 1.83GHz (GenuineIntel 686-class)
 1.83 GHz
 cpu0:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
 real mem  = 2145808384 (2046MB)
 avail mem = 2100625408 (2003MB)
 mainbus0 at root
 bios0 at mainbus0: AT/286+ BIOS, date 08/27/09, BIOS32 rev. 0 @
 0xfd6b0, SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
 bios0: vendor LENOVO version 79ETE5WW (2.25 ) date 08/27/2009
 bios0: LENOVO 2007FRG
 acpi0 at bios0: rev 2
 acpi0: sleep states S0 S3 S4 S5
 acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET BOOT SSDT SSDT
 SSDT SSDT
 acpi0: wakeup devices LID_(S3) SLPB(S3) LURT(S3) DURT(S3) EXP0(S4)
 EXP1(S4) EXP2(S4) EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3)
 USB7(S3) HDEF(S4)
 acpitimer0 at acpi0: 3579545 Hz, 24 bits
 acpiec0 at acpi0
 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: apic clock running at 166MHz
 cpu1 at mainbus0: apid 1 (application processor)
 cpu1: Genuine Intel(R) CPU T2400 @ 1.83GHz (GenuineIntel 686-class)
 1.83 GHz
 cpu1:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
 ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
 ioapic0: misconfigured as apic 2, remapped to apid 1
 acpihpet0 at acpi0: 14318179 Hz
 acpiprt0 at acpi0: bus 0 (PCI0)
 acpiprt1 at acpi0: bus 1 (AGP_)
 acpiprt2 at acpi0: bus 2 (EXP0)
 acpiprt3 at acpi0: bus 3 (EXP1)
 acpiprt4 at acpi0: bus 4 (EXP2)
 acpiprt5 at acpi0: bus 12 (EXP3)
 acpiprt6 at acpi0: bus 21 (PCI1)
 acpicpu0 at acpi0: C3, C2, C1, PSS
 acpicpu1 at acpi0: C3, C2, C1, PSS
 acpipwrres0 at acpi0: PUBS
 acpitz0 at acpi0: critical temperature 127 degC
 acpitz1 at acpi0: critical temperature 99 degC
 acpibtn0 at acpi0: LID_
 acpibtn1 at acpi0: SLPB
 acpibat0 at acpi0: BAT0 model 92P1127 serial 23233 type LION oem SANYO
 acpibat1 at acpi0: BAT1 not present
 acpiac0 at acpi0: AC unit online
 acpithinkpad0 at acpi0
 acpidock0 at acpi0: GDCK not docked (0)
 bios0: ROM list: 0xc/0xfe00 0xd/0x1000 0xd1000/0x1000
 0xdc000/0x4000! 0xe/0x1!
 cpu0: Enhanced SpeedStep 1829 MHz: speeds: 1833, 1333, 1000 MHz
 pci0 at mainbus0 bus 0: configuration mode 1 (bios)
 pchb0 at pci0 dev 0 function 0 Intel 82945GM Host rev 0x03
 ppb0 at pci0 dev 1 

Re: ext2fs 2GiB file size limit

2010-12-08 Thread LEVAI Daniel
On Wed, Dec 08, 2010 at 10:42:09 +0100, Guillaume Duali wrote:
[...]
 Hi,
 you could try it :
 http://www.openbsd.org/cgi-bin/man.cgi?query=newfs_ext2fssektion=8apropos=0manpath=OpenBSD+Currentarch=i386

So, you think recreating the filesystem would solve the problem? I'm
sorry, but I'm not used to the reboot if it's not working scheme.


Daniel

-- 
LIVAI Daniel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F



Re: ext2fs 2GiB file size limit

2010-12-08 Thread Peter J. Philipp
On Wed, Dec 08, 2010 at 09:23:49AM +0100, LEVAI Daniel wrote:
 I don't remember having a 2GiB filesize limit anywhere near, but the old
 extfs. What am I missing here?

Hi,

I think it is enforced here (in the file /sys/ufs/ext2fs/ext2fs_inode.c:

--
int
ext2fs_setsize(struct inode *ip, u_int64_t size)
{
if ((ip-i_e2fs_mode  IFMT) == IFREG ||
ip-i_e2fs_mode == 0) {
ip-i_e2fs_dacl = size  32;
if (size = 0x8000U) {

--

Which leaves probably this i_e2fs_mode which is probably a superblock flag.

I checked the newfs_ext2fs manpage and it says the following:

--
 -O filesystem-format
 Select the filesystem-format.

   0`GOOD_OLD_REV'; this option is primarily used to
build root file systems that can be understood by
old or dumb firmwares for bootstrap.  (default)
   1`DYNAMIC_REV'; various extended (and sometimes
incompatible) features are enabled (though not all
features are supported on OpenBSD).  Currently
only the following features are supported:
...some cut...
  LARGEFILEEnable files larger than 2G
   bytes.
--

so perhaps you need to turn on this LARGEFILE feature at newfs time somehow...

Good luck,

-peter



Re: ext2fs 2GiB file size limit

2010-12-08 Thread LEVAI Daniel
On Wed, Dec 08, 2010 at 12:47:06 +0100, Peter J. Philipp wrote:
 On Wed, Dec 08, 2010 at 09:23:49AM +0100, LEVAI Daniel wrote:
  I don't remember having a 2GiB filesize limit anywhere near, but the old
  extfs. What am I missing here?
snip useful research
 I checked the newfs_ext2fs manpage and it says the following:
 
 --
  -O filesystem-format
  Select the filesystem-format.
 
0`GOOD_OLD_REV'; this option is primarily used to
 build root file systems that can be understood by
 old or dumb firmwares for bootstrap.  (default)
1`DYNAMIC_REV'; various extended (and sometimes
 incompatible) features are enabled (though not all
 features are supported on OpenBSD).  Currently
 only the following features are supported:
 ...some cut...
   LARGEFILEEnable files larger than 2G
bytes.
 --
 
 so perhaps you need to turn on this LARGEFILE feature at newfs time 
 somehow...

Indeed.

It seems my ignorance and impudent style didn't get me anywhere (again).

Thanks to You and Guillaume for the pointers and the info!


Daniel

-- 
LIVAI Daniel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F