Mke2fs t ext4 b 4096 error 1

Environment: - Virtual machine on VMWare ESX 4.0 - OS: fully up to date RHEL 5.8 After adding a new (virtual) disk I want to create an ext4 partition on LVM on this disk. Steps taken so far: $ s...

Environment:
— Virtual machine on VMWare ESX 4.0
— OS: fully up to date RHEL 5.8

After adding a new (virtual) disk I want to create an ext4 partition on LVM on this disk.

Steps taken so far:

$ sudo /sbin/fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 10443.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
p
Partition number (1-4): 1
First cylinder (1-10443, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-10443, default 10443):
Using default value 10443

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
$ sudo /usr/sbin/pvcreate /dev/sdb1
  Writing physical volume data to disk "/dev/sdb1"
  Physical volume "/dev/sdb1" successfully created
$ sudo /usr/sbin/vgcreate VGora /dev/sdb1
  /dev/hdc: open failed: No medium found
  Volume group "VGora" successfully created
$ sudo /usr/sbin/lvcreate -l "100%FREE" -n oradata VGora
  Logical volume "oradata" created

Creating an ext4 partition fails:

$ sudo /sbin/mke2fs -t ext4 /dev/VGora/oradata
mke2fs 1.39 (29-May-2006)
mke2fs: invalid blocks count - /dev/VGora/oradata

More information on the created partition:

$ sudo /usr/sbin/vgdisplay VGora
  --- Volume group ---
  VG Name               VGora
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               80.00 GB
  PE Size               4.00 MB
  Total PE              20479
  Alloc PE / Size       20479 / 80.00 GB
  Free  PE / Size       0 / 0
  VG UUID               ggjERV-sGbG-1nCv-HW61-LJk4-I7cX-Z3Infh

$ sudo /usr/sbin/lvdisplay VGora
  --- Logical volume ---
  LV Name                /dev/VGora/oradata
  VG Name                VGora
  LV UUID                nia1PK-7JJ2-jg5T-uN4X-ggYH-R0mS-oqCooY
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                80.00 GB
  Current LE             20479
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:4

$ sudo /sbin/fdisk -l /dev/sdb

Disk /dev/sdb: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       10443    83883366   8e  Linux LVM

I can’t find any relevant information on this error and don’t know how to resolve this.

  • How can I check the block count? and
  • How can I correct it to a valid number for ext4?

I’m trying to test restoring a backed up linux file system /apps (ext3 filesystem)

/dev/cciss/c0d0p7     177G  3.8G  164G   3% /apps

I ran the following command to take a dump:

/sbin/dump -0uz -f /backup_labeir1/apps.dmp /apps

Then I deleted the /apps folder:

rm -rf /apps

And unmounted it:

umount -l /apps

Next I’m trying to make the file-system

mke2fs -j -b 4096 -L data /dev/cciss/c0d0p7

after which I’m planning to do the below steps:

# mkdir /apps
# mount -t ext3 /dev/cciss/c0d0p7 /apps
# cd /apps
# restore -rf /backup_labeir1/apps.dmp .
# reboot

I’ve 2 questions:

  1. Are my testing steps correct
  2. When I run the below I get the error:
    [root@labeir2 backup_labeir1]# mke2fs -F -j -b 4096 -L data /dev/cciss/c0d0p7
    mke2fs 1.39 (29-May-2006)
    /dev/cciss/c0d0p7 is apparently in use by the system; mke2fs forced anyway.
    /dev/cciss/c0d0p7: Device or resource busy while setting up superblock

But neither the filesystem is mounted nor lsof shows me any output:

 lsof | grep /dev/cciss/c0d0p7
 lsof /dev/cciss/c0d0p7

Please help me resolve this.

asked Aug 25, 2015 at 9:51

dig_123's user avatar

I got the same error when I tried to format a USB drive on Mac OS X. In my case, unmounting the disk first with diskutil unmountDisk ... solved the problem.

Details: First, run diskutil list and check the output to figure out which disk you want to format. (Don’t format your hard drive disk0!) In my case, it was /dev/disk1. When I first ran mkfs.ext3 /dev/disk1, I got the message «Resource busy while setting up superblock». But after I ran diskutil unmountDisk disk1, mkfs.ext3 worked.

Note: Initially, I tried diskutil eject disk1, but then the disk is not accessible anymore — e.g. diskutil list doesn’t show it. diskutil unmountDisk disk1 makes sure that the disk is no longer in use, but mkfs.ext3 can still access it.

answered Jan 23, 2016 at 1:28

jcsahnwaldt Reinstate Monica's user avatar

/dev/cciss/c0d0p7: Device or resource busy while setting up superblock

From my experience, resource busy cause by multipath device map(might have). (e.g. /dev/mapper/mpathi)

If we have this problem, «mke2fs -t ext4 /dev/mapper/mpathi» and «» will fail.

[root@myserver ~]# multipath -ll mpathi
mpathi (snip:myFCdisk) dm-6 snip:myFCdiskProdName
size=100G features='0' hwhandler='1 alua' wp=ro
|-+- policy='round-robin 0' prio=snip:123 status=active
| `- 6:0:0:7  sdv  65:80  active ready  running
`-+- policy='round-robin 0' prio=snip:111 status=enabled
  `- 5:0:0:7  sdi  8:128  active ready  running
[root@myserver ~]#
[root@myserver ~]# mke2fs -F -t ext4 /dev/mapper/mpathi
mke2fs 1.41.12 (17-May-2010)
/dev/mapper/mpathi: Operation not permitted while setting up superblock
[root@myserver ~]#
[root@myserver ~]# mke2fs -F -t ext4 /dev/sdv
mke2fs 1.41.12 (17-May-2010)
/dev/sdv is apparently in use by the system; will not make a filesystem here!
[root@myserver ~]#

My workaround is removing multipath device map temporarily.

  1. remove multipath device name.(multipath -f /dev/mapper/mpathi)
  2. run mke2fs for mpath slave device(e.g. mke2fs -F -t ext4 /dev/sdv)
  3. rebuild multipath device map.(multipath -r)

Have a good day:)

answered Oct 7, 2015 at 6:15

Splatoon girl's user avatar

Environment:
— Virtual machine on VMWare ESX 4.0
— OS: fully up to date RHEL 5.8

After adding a new (virtual) disk I want to create an ext4 partition on LVM on this disk.

Steps taken so far:

$ sudo /sbin/fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 10443.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
p
Partition number (1-4): 1
First cylinder (1-10443, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-10443, default 10443):
Using default value 10443

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
$ sudo /usr/sbin/pvcreate /dev/sdb1
  Writing physical volume data to disk "/dev/sdb1"
  Physical volume "/dev/sdb1" successfully created
$ sudo /usr/sbin/vgcreate VGora /dev/sdb1
  /dev/hdc: open failed: No medium found
  Volume group "VGora" successfully created
$ sudo /usr/sbin/lvcreate -l "100%FREE" -n oradata VGora
  Logical volume "oradata" created

Creating an ext4 partition fails:

$ sudo /sbin/mke2fs -t ext4 /dev/VGora/oradata
mke2fs 1.39 (29-May-2006)
mke2fs: invalid blocks count - /dev/VGora/oradata

More information on the created partition:

$ sudo /usr/sbin/vgdisplay VGora
  --- Volume group ---
  VG Name               VGora
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               80.00 GB
  PE Size               4.00 MB
  Total PE              20479
  Alloc PE / Size       20479 / 80.00 GB
  Free  PE / Size       0 / 0
  VG UUID               ggjERV-sGbG-1nCv-HW61-LJk4-I7cX-Z3Infh

$ sudo /usr/sbin/lvdisplay VGora
  --- Logical volume ---
  LV Name                /dev/VGora/oradata
  VG Name                VGora
  LV UUID                nia1PK-7JJ2-jg5T-uN4X-ggYH-R0mS-oqCooY
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                80.00 GB
  Current LE             20479
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:4

$ sudo /sbin/fdisk -l /dev/sdb

Disk /dev/sdb: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       10443    83883366   8e  Linux LVM

I can’t find any relevant information on this error and don’t know how to resolve this.

  • How can I check the block count? and
  • How can I correct it to a valid number for ext4?

On Ubuntu 20.04 LTS. I have an AOSP tree checked out at android-10.0.0_r39. The tree builds fine for walleye — I can build an run on a device, no issues. I have no new files in the AOSP repo tree. If I switch to blueline, though, I get:

lunch aosp_blueline-userdebug
...
[ 99% 67222/67226] Target system fs image: out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system.img
FAILED: out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system.img
/bin/bash -c "(if [ -d out/target/product/blueline/system/vendor ] && [ ! -h out/target/product/blueline/system/vendor ]; then echo 'Non-symlink out/target/product/blueline/system/vendor detected!' 1>&2; echo 'You cannot install files to out/target/product/blueline/system/vendor while building a separate vendor.img!' 1>&2; exit 1; fi ) && (ln -sf /vendor out/target/product/blueline/system/vendor ) && (if [ -d out/target/product/blueline/system/product ] && [ ! -h out/target/product/blueline/system/product ]; then echo 'Non-symlink out/target/product/blueline/system/product detected!' 1>&2; echo 'You cannot install files to out/target/product/blueline/system/product while building a separate product.img!' 1>&2; exit 1; fi ) && (ln -sf /product out/target/product/blueline/system/product ) && (( cd out/target/product/blueline/system && findres=$(find lib* -path "lib/bootstrap" -prune -o -path "lib64/bootstrap" -prune -o -path "lib/arm" -prune -o -path "lib/arm64" -prune -o -path "lib/vndk-*" -prune -o -path "lib64/vndk-*" -prune -o -type f \( -false -o -name libadbconnection.so -o -name libadbconnectiond.so -o -name libandroidicu.so -o -name libandroidio.so -o -name libart-compiler.so -o -name libart-dexlayout.so -o -name libart-disassembler.so -o -name libart.so -o -name libartbase.so -o -name libartbased.so -o -name libartd-compiler.so -o -name libartd-dexlayout.so -o -name libartd.so -o -name libartpalette.so -o -name libc.so -o -name libdexfile.so -o -name libdexfile_external.so -o -name libdexfiled.so -o -name libdexfiled_external.so -o -name libdl.so -o -name libdt_fd_forward.so -o -name libdt_socket.so -o -name libicui18n.so -o -name libicuuc.so -o -name libjavacore.so -o -name libjdwp.so -o -name libm.so -o -name libnativebridge.so -o -name libnativehelper.so -o -name libnativeloader.so -o -name libnpt.so -o -name libopenjdk.so -o -name libopenjdkjvm.so -o -name libopenjdkjvmd.so -o -name libopenjdkjvmti.so -o -name libopenjdkjvmtid.so -o -name libpac.so -o -name libprofile.so -o -name libprofiled.so -o -name libsigchain.so -o -name libjavacrypto.so \) -print) && if [ -n "$findres" ]; then echo "APEX libraries found in system image (see comment for check-apex-libs-absence" 1>&2; echo "in build/make/core/main.mk for details):" 1>&2; echo "$findres" | sort 1>&2; false; fi; ) ) && (mkdir -p out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/ out/target/product/blueline/obj/PACKAGING/systemimage_intermediates && rm -rf out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "system_other_size=2952790016" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "system_journal_size=0" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "ext_mkuserimg=mkuserimg_mke2fs" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "fs_type=ext4" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "extfs_sparse_flag=-s" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "squashfs_sparse_flag=-s" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "ext4_share_dup_blocks=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "selinux_fc=out/target/product/blueline/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_avbtool=avbtool" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_system_hashtree_enable=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_system_add_hashtree_footer_args=--prop com.android.build.system.os_version:10 --prop com.android.build.system.security_patch:2020-06-05" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_system_other_hashtree_enable=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_system_other_add_hashtree_footer_args=--rollback_index 1591315200" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_system_other_key_path=external/avb/test/data/testkey_rsa4096.pem" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_system_other_algorithm=SHA256_RSA4096" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_vendor_hashtree_enable=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_vendor_add_hashtree_footer_args=--prop com.android.build.vendor.os_version:10 --prop com.android.build.vendor.security_patch:2020-06-05" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_product_hashtree_enable=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_product_add_hashtree_footer_args=--prop com.android.build.product.os_version:10 --prop com.android.build.product.security_patch:2020-06-05" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_product_services_hashtree_enable=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_product_services_add_hashtree_footer_args=--prop com.android.build.product_services.os_version:10 --prop com.android.build.product_services.security_patch:2020-06-05" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_odm_hashtree_enable=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "avb_odm_add_hashtree_footer_args=--prop com.android.build.odm.os_version:10" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "recovery_as_boot=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "root_dir=out/target/product/blueline/root" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "use_dynamic_partition_size=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo "skip_fsck=true" >>  out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (PATH=out/host/linux-x86/bin/:$PATH build/make/tools/releasetools/build_image.py out/target/product/blueline/system out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system_image_info.txt out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/blueline/system || ( mkdir -p ${DIST_DIR}; cp out/target/product/blueline/installed-files.txt ${DIST_DIR}/installed-files-rescued.txt; exit 1 ) )"
2020-06-18 22:52:22 - build_image.py - ERROR   : Failed to build out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system.img from out/target/product/blueline/system
Out of space? Out of inodes? The tree size of /pool/james/aosp/out/soong/.temp/tmpceCvjm is 153844736 bytes (146 MB), with reserved space of 0 bytes (0 MB).
The max image size for filesystem files is 73134080 bytes (69 MB), out of a total partition size of 73134080 bytes (69 MB).
Traceback (most recent call last):
  File "build/make/tools/releasetools/build_image.py", line 789, in <module>
    main(sys.argv[1:])
  File "build/make/tools/releasetools/build_image.py", line 781, in main
    BuildImage(in_dir, image_properties, out_file, target_out)
  File "build/make/tools/releasetools/build_image.py", line 423, in BuildImage
    BuildImageMkfs(in_dir, prop_dict, out_file, target_out, fs_config)
  File "build/make/tools/releasetools/build_image.py", line 334, in BuildImageMkfs
    mkfs_output = common.RunAndCheckOutput(build_command)
  File "/pool/james/aosp/build/make/tools/releasetools/common.py", line 252, in RunAndCheckOutput
    args, proc.returncode, output))
common.ExternalError: Failed to run command '['mkuserimg_mke2fs', '-s', '/pool/james/aosp/out/soong/.temp/tmpceCvjm', 'out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system.img', 'ext4', '/', '73134080', '-j', '0', '-D', 'out/target/product/blueline/system', '-L', '/', '-i', '3256', '-M', '0', '-c', '--inode_size', '256', 'out/target/product/blueline/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin']' (exit code 4):
22:52:21 mkuserimg_mke2fs.py INFO: Env: {'MKE2FS_CONFIG': './system/extras/ext4_utils/mke2fs.conf'}
22:52:21 mkuserimg_mke2fs.py INFO: Running: mke2fs -O ^has_journal -L / -N 3256 -I 256 -M / -m 0 -E android_sparse -t ext4 -b 4096 out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system.img 17855
22:52:21 mkuserimg_mke2fs.py INFO: Env: {}
22:52:21 mkuserimg_mke2fs.py INFO: Running: e2fsdroid -p out/target/product/blueline/system -s -S out/target/product/blueline/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin -f /pool/james/aosp/out/soong/.temp/tmpceCvjm -a / out/target/product/blueline/obj/PACKAGING/systemimage_intermediates/system.img
22:52:22 mkuserimg_mke2fs.py ERROR: Failed to run e2fsdroid_cmd: __populate_fs: Could not allocate block in ext2 filesystem while writing file "com.android.runtime.debug.apex"
e2fsdroid: Could not allocate block in ext2 filesystem while populating file system

mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 17855 4k blocks and 3264 inodes

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done


__populate_fs: Could not allocate block in ext2 filesystem while writing file "com.android.runtime.debug.apex"
e2fsdroid: Could not allocate block in ext2 filesystem while populating file system


22:52:33 ninja failed with: exit status 1

#### failed to build some targets (01:27:37 (hh:mm:ss)) ####

Suggestions?

View previous topic :: View next topic  
Author Message
optiluca
Guru
Guru

Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Aug 03, 2010 10:18 am    Post subject: [solved] 4k sectors partitioning question Reply with quote

Hi all. I have recently purchased a laptop with a 4k sector, «advanced format» drive. I know these drives need to be treated carefully, namely ensuring that all partitions start on a sector multiple of 8 (even though I have seen other values such as 64 and 2048 floating around :? ). I am unsure however as to how to deal with logical partitions. Does only the «container» partition have to be aligned, or must they all start at sectors multiple of 8? I have also seen constrasting opinions regarding any measures that should be taken when formatting the partitions, with some claims that this operation needs to be «aligned» too. If so, how?

Thanks in advance, and apologies if this has already been asked before. I have seen a few 4k sector threads, but none really addressed these questions.

PS On a side note, should I use ext4 over ext3? Apart from a speeded up integrity check I really can’t see anything of interest to a desktop user… :? Performance does not seem to be clearly better either, at least from what I have seen from Phoronix benchmarks… :roll:
_________________
# «Hmm, sounds like your system froze up.»

# «I don’t know why. It’s about 80 degrees in here!»

http://www.rinkworks.com/stupid/cs_mincing.shtml

Last edited by optiluca on Wed Aug 04, 2010 6:56 am; edited 1 time in total

Back to top

View user's profile Send private message

richard.scott
Veteran
Veteran

Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Tue Aug 03, 2010 10:40 am    Post subject: Reply with quote

You could try this after emerging ‘parted’:

Code:
# parted —script /dev/sda mklabel gpt

# parted —align=min —script ${1} mkpart primary 0% 100%

# parted —script /dev/sda print

1. The mklabel gpt thing creates a GPT style partition table which seems to be required for bigger disks.

2. The —align option should align the partitions for you. Check the parted man page for other —align= options.

Rich.

Back to top

View user's profile Send private message

optiluca
Guru
Guru

Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Aug 03, 2010 11:22 am    Post subject: Reply with quote

The drive currently has a few windows partitions that I would like to keep, so I guess there’s no touching the partition table. In any case, I have successfully used fdisk many times over and would be much more comfortable using fdisk & common sense vs. an «automagic» solution which could wreak havoc on my windows partitions. :? Could anyone confirm that using the «multiple of 8» strategy is indeed correct?

Thanks anyway :)
_________________
# «Hmm, sounds like your system froze up.»

# «I don’t know why. It’s about 80 degrees in here!»

http://www.rinkworks.com/stupid/cs_mincing.shtml

Back to top

View user's profile Send private message

frostschutz
Advocate
Advocate

Joined: 22 Feb 2005
Posts: 2972
Location: Germany

PostPosted: Tue Aug 03, 2010 12:17 pm    Post subject: Reply with quote

parted —align did not work for me (with an wd15ears drive that reports itself as being 512byte sector based).

In sectors, multiple of 8 works for 4k alignment, since one sector = 512 bytes, 8 sectors = 4k.

The container for the logical partitions does not matter, them partition themselves do. You have to align _all_ partitions that will later actually contain filesystems (or swap).

Or to explain the other way around:

— filesystems should use 4k blocksizes (careful when mkfs.)

— all storage layers below the filesystem (lvm, raid, encryption, partitions, …) have to be 4k aligned so it ends up 4k aligned on the physical disk itself

I used parted (although manually). Mainly because I’m using GPT partitions, with traditional dos partitions I’d probably make the partition layout with cfdisk, and verify / fix the 4k alignment with sfdisk.

Back to top

View user's profile Send private message

optiluca
Guru
Guru

Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Aug 03, 2010 12:59 pm    Post subject: Reply with quote

Ok thank you very much :) One last doubt however. What blocksize does ext3 normally use? I would have guessed 512 bytes but according to http://linux.die.net/man/8/mke2fs , that is not even an option. How does the filesystem block size relate to the physical size? Is the idea that the filesystem block size must be at least the physical size?

Quote:
-b block-size

Specify the size of blocks in bytes. Valid block size vales are 1024, 2048 and 4096 bytes per block.

Thanks to all again :)
_________________
# «Hmm, sounds like your system froze up.»

# «I don’t know why. It’s about 80 degrees in here!»

http://www.rinkworks.com/stupid/cs_mincing.shtml

Back to top

View user's profile Send private message

hielvc
Advocate
Advocate

Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Tue Aug 03, 2010 5:48 pm    Post subject: Reply with quote

-b block-size

Specify the size of blocks in bytes. Valid block size vales are 1024, 2048 and 4096 bytes per block. If omitted, mke2fs block-size is heuristically determined by the file system size and the expected usage of the filesystem (see the -T option). If block-size is negative, then mke2fs will use heuristics to determine the appropriate block size, with the constraint that the block size will be at least block-size bytes. This is useful for certain hardware devices which require that the blocksize be a multiple of 2k.

mke2fs -b 4096 … shoud do it.
_________________
An A-Z Index of the Linux BASH command line

Back to top

View user's profile Send private message

optiluca
Guru
Guru

Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Aug 03, 2010 5:51 pm    Post subject: Reply with quote

I figured, I was merely puzzled as to what one does with a standard 512 byte sector considering that is not even an option…

BTW all my preinstalled windows partitions have a starting sector which is multiple of 2048 (with the first partition beginning on 2048 exactly). Why is that? :?
_________________
# «Hmm, sounds like your system froze up.»

# «I don’t know why. It’s about 80 degrees in here!»

http://www.rinkworks.com/stupid/cs_mincing.shtml

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19775

PostPosted: Wed Aug 04, 2010 2:45 am    Post subject: Reply with quote

optiluca wrote:
I figured, I was merely puzzled as to what one does with a standard 512 byte sector considering that is not even an option…

The hardware used 512 byte sectors for many years. There is no reason for the filesystem to use such small sectors. Smaller sectors require more metadata to track the same number of bytes, so there is a trade off between making sectors so small that the metadata wastes space on the drive or making sectors so large that the slack in the final sector of a file wastes an unacceptable amount of space.

optiluca wrote:
BTW all my preinstalled windows partitions have a starting sector which is multiple of 2048 (with the first partition beginning on 2048 exactly). Why is that? :?

That was probably done to ensure that they were aligned to the 4K boundary of the drive. As for why they are aligned to a larger multiple than strictly required, you would need to ask the vendor who prepared it that way.

Back to top

View user's profile Send private message

dmpogo
Advocate
Advocate

Joined: 02 Sep 2004
Posts: 3179
Location: Canada

PostPosted: Wed Aug 04, 2010 3:11 am    Post subject: Reply with quote

Do align beginnings of all partitions on 2048 kbyte (2 MB) boundaries — both extended container, and logical partitions inside *). I find it easiest (I am old-fashioned) to do it with fdisk -u (which shows everything in sectors 512 sectors, you can switch to this view from inside fdisk as well).

*) It is not a ‘must’ — minimum you should try to align on 4k if it is mechanical drive (the first partition should start at sector 64 then)

and on 512k if it is SSD, but 2048k alignment is becoming standard, both Windows 7 and Mac OSX do this.

Correction: It is 1MB=1024k=2048 sectors alignment not 2MB, so align on 2048 sectors, not kilobytes.

Last edited by dmpogo on Wed Aug 04, 2010 6:05 am; edited 2 times in total

Back to top

View user's profile Send private message

optiluca
Guru
Guru

Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Wed Aug 04, 2010 5:48 am    Post subject: Reply with quote

dmpogo wrote:
Do align beginnings of all partitions on 2048 kbyte (2 MB) boundaries — both extended container, and logical partitions inside *). I find it easiest (I am old-fashioned) to do it with fdisk -u (which shows everything in sectors 512 sectors, you can switch to this view from inside fdisk as well).

So to align to 2048 kbyte boundaries, that would require multiples of 4096? That is not what my current windows partitions are using :? Windows seems to be aligning to 1MB boundaries as it stands. I have now partitioned the drive following this same convention, beginning every single partition on a multiple of 2048. Hope that’s right :D

Thanks to all again for your very prompt and exhaustive replies :)
_________________
# «Hmm, sounds like your system froze up.»

# «I don’t know why. It’s about 80 degrees in here!»

http://www.rinkworks.com/stupid/cs_mincing.shtml

Back to top

View user's profile Send private message

dmpogo
Advocate
Advocate

Joined: 02 Sep 2004
Posts: 3179
Location: Canada

PostPosted: Wed Aug 04, 2010 5:57 am    Post subject: Reply with quote

optiluca wrote:
dmpogo wrote:
Do align beginnings of all partitions on 2048 kbyte (2 MB) boundaries — both extended container, and logical partitions inside *). I find it easiest (I am old-fashioned) to do it with fdisk -u (which shows everything in sectors 512 sectors, you can switch to this view from inside fdisk as well).

So to align to 2048 kbyte boundaries, that would require multiples of 4096? That is not what my current windows partitions are using :? Windows seems to be aligning to 1MB boundaries as it stands. I have now partitioned the drive following this same convention, beginning every single partition on a multiple of 2048. Hope that’s right :D

Thanks to all again for your very prompt and exhaustive replies :)

I have misspoke and it is of course 1MB. Double checked, yes, my drive partitions, they do start at block 2048.

I guess I picked up on your 2048 in the opening post and mentally converted it into 2 MB :)

well, we through megabytes around, and I still have my first laptop operation which has 20 MB harddrive total. And it had windows, word, a book my wife wrote, all in that space.

Back to top

View user's profile Send private message

optiluca
Guru
Guru

Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Wed Aug 04, 2010 6:58 am    Post subject: Reply with quote

Ok thanks for confirming that :) In that case I shall proceed with my installation, which has now encountered an immense circular dependency issue, but that is for another thread… :P

Thanks to all :D
_________________
# «Hmm, sounds like your system froze up.»

# «I don’t know why. It’s about 80 degrees in here!»

http://www.rinkworks.com/stupid/cs_mincing.shtml

Back to top

View user's profile Send private message

kernelOfTruth
Watchman
Watchman

Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Fri Dec 10, 2010 1:16 pm    Post subject: Reply with quote

this should answer some questions:

Linux on 4KB-sector disks: Practical advice

with the latest parted (2.2 or 2.3) and gparted (0.7, probably also 0.6.2) you just need to follow the advice in the posted link or

leave it set at «Align to:» MiB (in gparted 0.7) — so that gparted will take care of that for you :)

sample result:

Quote:
Device Boot Start End Blocks Id System

/dev/sda1 2048 2050047 1024000 83 Linux

/dev/sda2 2050048 104450047 51200000 7 HPFS/NTFS


_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0

https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D

Back to top

View user's profile Send private message

Atha
Apprentice
Apprentice

Joined: 22 Sep 2004
Posts: 215

PostPosted: Wed Apr 13, 2011 3:36 pm    Post subject: Reply with quote

Hi!

I just faced the same problems with my new Hitachi Deskstar 5K3000 2 TB SATA-III (6Gb/s) 5400rpm hard drive. I already had a 2 TB Western Digital Caviar Green WD20EADS (512b blocks) which didn’t need any adjustment/alignment – obviously. So with the Hitachi it is the first time I’m confronted with the new “Advanced Format Technology”.

Since the Hitachi Deskstar reports 512b blocks but realy has 4k blocks, the multiple of 8 rule seemed to be the only way to go.

Code:
# parted /dev/sdc

GNU Parted 2.3

Verwende /dev/sdc

Willkommen zu GNU Parted! Geben Sie ‘help’ ein, um eine Liste der verfügbaren Kommados zu erhalten.

(parted) unit s

(parted) print

Modell: ATA Hitachi HDS5C302 (scsi)

Festplatte  /dev/sdc:  3907029168s

Sektorgröße (logisch/physisch): 512B/512B

Partitionstabelle: gpt

Nummer  Anfang  Ende         Größe        Dateisystem  Name     Flags

 1      40s     3907029128s  3907029089s  ext4         primary

(parted) quit

(Sorry, German language)

I set the end also to be a multiple of 8. Don’t know if this is really necessary, but it seemed logical to me.

The filesystem is Ext4, and I used mke2fs -T ext4 -t ext4 -b 4096 to create it.

How do I test the drives’ performance?

Back to top

View user's profile Send private message

Delicates
n00b
n00b

Joined: 19 Jul 2005
Posts: 6

PostPosted: Sun Apr 24, 2011 12:09 pm    Post subject: Reply with quote

Atha wrote:

Code:

Nummer  Anfang  Ende         Größe        Dateisystem  Name     Flags

 1      40s     3907029128s  3907029089s  ext4         primary



I set the end also to be a multiple of 8. Don’t know if this is really necessary, but it seemed logical to me.

The filesystem is Ext4, and I used mke2fs -T ext4 -t ext4 -b 4096 to create it.

The end sector number should be a multiple of 8 less by 1 (LBA numbering starts at 0), otherwise the size of your entire partition (3907029089s reported above) is not divisible by 8 sectors.

I’m currently slowly going through installation of the Advanced Format Technology (AFT) 3TB Hitachi Deskstar 7K3000 (HDS723030ALA640) under Gentoo Linux with a single ext4 partition.

The drive uses Advanced Format 512 emulation (512e) — that is even though the drive uses 4096 byte sector sizes, it reports 512 byte sectors to OS/BIOS/Apps, not 4k.

Code:

# dmesg | egrep ‘ata5|sd 4|sdd’

ata5: SATA max UDMA/133 abar m2048@0xfbffc000 port 0xfbffc300 irq 43

ata5: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

ata5.00: ATA-8: Hitachi HDS723030ALA640, MKAOA3B0, max UDMA/133

ata5.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA

ata5.00: configured for UDMA/133

sd 4:0:0:0: [sdd] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)

sd 4:0:0:0: Attached scsi generic sg4 type 0

sd 4:0:0:0: [sdd] Write Protect is off

sd 4:0:0:0: [sdd] Mode Sense: 00 3a 00 00

sd 4:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUA

 sdd: unknown partition table

sd 4:0:0:0: [sdd] Attached SCSI disk

Of course initially I had to ensure required Kernel ( 2.6.38 ) configuration is enabled:

Code:

Enable the block layer (BLOCK)  —>

     [*] Support for large (2TB+) block devices and files (LBDAF)

File systems  —>

     [*] The Extended 4 (ext4) filesystem

     Partition Types  —>

          [*] Advanced Partition Selection (PARTITION_ADVANCED)  —>

               [*] EFI GUID Partition Support (EFI_PARTITION)

LBDAF option is required for 32bit systems only, and is not needed/available for 64bit.

Then I tried using Gnome Disk Utility, but while it allowed creation of a GUID Partition Table (GPT) it did not provide any control over partition alignment.

It was good however for performing an initial thorough scan of disk surface for errors and the SMART report.

I found GPT fdisk (gdisk) to be slightly easier to use than GNU Parted (parted), as it allows you to set a partition alignment value (default is 2048 sectors or 1MiB, which I changed to 8 sectors), the alignment value works on partition start, but not on partition end, so I had to specify the right last sector manually:

Code:

# gdisk /dev/sdd

GPT fdisk (gdisk) version 0.7.1

Partition table scan:

  MBR: protective

  BSD: not present

  APM: not present

  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): x

Expert command (? for help): d

Partitions will begin on 2048-sector boundaries.

Expert command (? for help): l 8

Enter the sector alignment value (1-65536, default = 2048): 8

Expert command (? for help): d

Partitions will begin on 8-sector boundaries.

Expert command (? for help): m

Command (? for help): n

Partition number (1-128, default 1):

First sector (34-5860533134, default = 34) or {+-}size{KMGTP}:

Information: Moved requested sector from 34 to 40 in

order to align on 8-sector boundaries.

Use ‘l’ on the experts’ menu to adjust alignment

Last sector (40-5860533134, default = 5860533134) or {+-}size{KMGTP}: 5860533127

Current type is ‘Linux/Windows data’

Hex code or GUID (L to show codes, Enter = 0700):

Changed type of partition to ‘Linux/Windows data’

Command (? for help): i

Using 1

Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Linux/Windows data)

Partition unique GUID: 8D8AF9DF-9C0B-4787-8003-86986EF1EC5F

First sector: 40 (at 20.0 KiB)

Last sector: 5860533127 (at 2.7 TiB)

Partition size: 5860533088 sectors (2.7 TiB)

Attribute flags: 0000000000000000

Partition name: ‘Linux/Windows data’

Command (? for help): c

Using 1

Enter name: STORAGE

Command (? for help): p

Disk /dev/sdd: 5860533168 sectors, 2.7 TiB

Logical sector size: 512 bytes

Disk identifier (GUID): C49984B5-9824-42EA-9F0E-B6BEC4A41F38

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 5860533134

Partitions will be aligned on 8-sector boundaries

Total free space is 13 sectors (6.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name

   1              40      5860533127   2.7 TiB     0700  STORAGE

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

PARTITIONS!!

Do you want to proceed? (Y/N): y

OK; writing new GUID partition table (GPT).

The operation has completed successfully.

# parted /dev/sdd

GNU Parted 2.3

Using /dev/sdd

Welcome to GNU Parted! Type ‘help’ to view a list of commands.

(parted) u s                                                             

(parted) p                                                               

Model: ATA Hitachi HDS72303 (scsi)

Disk /dev/sdd: 5860533168s

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number  Start  End          Size         File system  Name     Flags

 1      40s    5860533127s  5860533088s               STORAGE

(parted) q                                                               

#

And finally formatting with ext4.

As this drive is purely for storage and is not for any system partition — don’t reserve anything for super user, allowing normal users to fill the entire drive, and disabling huge_file support/overhead as I doubt I’ll store files larger than 2TB on this 3TB drive. Also even on smaller drives, 32bit systems would not be able to mount the default huge_file ext4 file systems without LBDAF kernel setting enabled. If needed huge_file can be enabled later with tune2fs.

Code:

# mkfs.ext4 -m 0 -O ^huge_file -L STORAGE /dev/sdd1

mke2fs 1.41.14 (22-Dec-2010)

Filesystem label=STORAGE

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

183148544 inodes, 732566636 blocks

0 blocks (0.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

22357 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

        102400000, 214990848, 512000000, 550731776, 644972544

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

# tune2fs -l /dev/sdd1

tune2fs 1.41.14 (22-Dec-2010)

Filesystem volume name:   STORAGE

Last mounted on:          <not available>

Filesystem UUID:          5a2179ea-884a-44fd-9af9-43dfe9caa41c

Filesystem magic number:  0xEF53

Filesystem revision #:    1 (dynamic)

Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file uninit_bg dir_nlink extra_isize

Filesystem flags:         signed_directory_hash

Default mount options:    (none)

Filesystem state:         clean

Errors behavior:          Continue

Filesystem OS type:       Linux

Inode count:              183148544

Block count:              732566636

Reserved block count:     0

Free blocks:              721019814

Free inodes:              183148533

First block:              0

Block size:               4096

Fragment size:            4096

Reserved GDT blocks:      849

Blocks per group:         32768

Fragments per group:      32768

Inodes per group:         8192

Inode blocks per group:   512

Flex block group size:    16

Filesystem created:       Sun Apr 24 21:23:26 2011

Last mount time:          n/a

Last write time:          Sun Apr 24 21:23:36 2011

Mount count:              0

Maximum mount count:      29

Last checked:             Sun Apr 24 21:23:26 2011

Check interval:           15552000 (6 months)

Next check after:         Fri Oct 21 22:23:26 2011

Lifetime writes:          152 MB

Reserved blocks uid:      0 (user root)

Reserved blocks gid:      0 (group root)

First inode:              11

Inode size:               256

Required extra isize:     28

Desired extra isize:      28

Journal inode:            8

Default directory hash:   half_md4

Directory Hash Seed:      bdcfb23e-5918-4742-94e5-aae3e5a0b23a

Journal backup:           inode blocks

#

After copying all files (using cp -av) from a filled up 1.5TB ext3 drive onto this new 3TB drive, I had 1.5GB of space saving reported by du on the new file system.

Interestingly diff -u of ls -lR output on both drives has shown that on ext4 the size of some directories (with 200+ files) increased (by one 4k block), while size of other (with 1500+ files) decreased (by 29 blocks).

Back to top

View user's profile Send private message

xdarma
l33t
l33t

Joined: 08 Dec 2003
Posts: 715
Location: tra veneto e friuli (italy)

PostPosted: Sun Oct 02, 2011 7:19 am    Post subject: Reply with quote

kernelOfTruth wrote:
this should answer some questions:

Linux on 4KB-sector disks: Practical advice



Thanks for the link (and thank you google for cache ;-), this is the fdisk command line:

Quote:
Another approach with fdisk is to launch it as fdisk -H 224 -S 56 /dev/sda, which changes the cylinder/head/sector (CHS) geometry to guarantee proper 4096-byte alignment when the program aligns to cylinders, as it does by default.


_________________
proud user of faKeDE-4.7.3 -> back to windowmaker -> moved to LXQt

Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


    • #1

    Hi guys,

    I’m trying to set up OMV on my new NAS with 3 5TB drives (new) and 4 2TB drives (old).
    When I’m trying to create a new file system it fails on one drive. On every other drive there weren’t any problems.

    error message:

    Error #0:
    exception 'OMVExecException' with message 'Failed to execute command 'export LANG=C; mkfs -V -t ext4 -b 4096 -m 0 -E lazy_itable_init=0,lazy_journal_init=0 -O 64bit -L 'Daten5' /dev/sdg1 2>&1': mke2fs 1.42.12 (29-Aug-2014)
    The file /dev/sdg1 does not exist and no size was specified.' in /usr/share/openmediavault/engined/rpc/filesystemmgmt.inc:601
    Stack trace:
    #0 [internal function]: OMVRpcServiceFileSystemMgmt->create(Array, Array)
    #1 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array)
    #2 /usr/share/php/openmediavault/rpc/rpc.inc(81): OMVRpcServiceAbstract->callMethod('create', Array, Array)
    #3 /usr/sbin/omv-engined(524): OMVRpcRpc::call('FileSystemMgmt', 'create', Array, Array, 1)
    #4 {main}

    fdsik output:

    Command (m for help): p
    Disk /dev/sdg: 1,8 TiB, 2000398934016 bytes, 3907029168 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
    Disklabel type: gpt
    Disk identifier: 3EF85236-045F-4020-BA99-B9DFCE3EA7B9
    
    
    Device     Start        End    Sectors  Size Type
    /dev/sdg1   2048 3907029134 3907027087  1,8T Linux filesystem

    Alles anzeigen

    I did find a bug report in Mantis but with no result or any tips how to resolve the problem (http://bugtracker.openmediavault.org/view.php?id=1539)

    I’m not that good with linux. I tried google without any success. I know OMV 3 ist still beta and this could be a bug. I’m happy to help out identifying the bug and resolve the issue if you can tell me how :D

    • Offizieller Beitrag
    • #2

    Did you wipe the drive? Look in Physical Devices tab if you didn’t.

    • #3

    Yes I did wipe all the old drives (Quick mode).

    I just tested the command from the error message via ssh:

    root@NAS:~# mkfs -V -t ext4 -b 4096 -m 0 -E lazy_itable_init=0,lazy_journal_init                                                                                                                                                             =0 -O 64bit -L 'Daten5' /dev/sdg1 2>&1
    mkfs from util-linux 2.25.2
    mkfs.ext4 -b 4096 -m 0 -E lazy_itable_init=0,lazy_journal_init=0 -O 64bit -L Dat                                                                                                                                                             en5 /dev/sdg1
    mke2fs 1.42.12 (29-Aug-2014)
    Ein Dateisystems mit 488378385 (4k) Blöcken und 122101760 Inodes wird erzeugt.
    UUID des Dateisystems: 2844218f-73f0-4c6c-b541-39628d95424b
    Superblock-Sicherungskopien gespeichert in den Blöcken:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
            102400000, 214990848
    
    
    beim Anfordern von Speicher für die Gruppentabellen: erledigt                                                                                                                                                                                
    Inode-Tabellen werden geschrieben: erledigt
    Das Journal (32768 Blöcke) wird angelegt: erledgt
    Die Superblöcke und die Informationen über die Dateisystemnutzung werden
    geschrieben: erledigt

    Alles anzeigen

    I’m sorry the output is in german.
    If you do it manually there doesn’t seem to be a problem. After refreshing the WebGUI the drive gets listed correctly in the File System tab.
    I don’t know why the OMV script running the command doesn’t work but at least there seems to be a workaround. If you want me testing something for debugging purposes I’m happy to help out.

    • Offizieller Beitrag
    • #4

    Try:

    dd if=/dev/zero of=/dev/sdg bs=512 count=10000

    Then see if you can create a filesystem in the webgui.

    • #5

    I deleted the file system I created manually and did what you asked but I got the same error message.

    • Offizieller Beitrag
    • #6

    You shouldn’t have to delete anything if you zero’d the drive with the command I posted.

    I would post a new bug on bugtracker. Maybe there is something Volker would have you try.

    • #7

    I did create a file system before manually. I thought I had to remove it first in order to create a new one through the WebGUI. Nevertheless it shouldn’t make any difference because I did use your command after deleting the file system.

    I did leave a note in Mantis in the existing bug report (bug report isn’t that old, didn’t want to post a new bug report for the samebug).

    edit: I did install OMV2 yesterday night because OMV 3 seemed too unstable for me and there weren’t any problems. Just wanted to let you know.

Ubuntu 12.04 LTS, I’ve added a new drive to the system, partitioned it with fdisk and am now trying to format it with mke2fs. The command is failing because it thinks the inodes_count and number of blocks are zero.

NOTE: -n = simulate actions

$ sudo mke2fs -c -L backups -t ext4 -T default -v -n /dev/sdc1
mke2fs 1.42 (29-Nov-2011)
fs_types for mke2fs.conf resolution: 'ext4'
mke2fs: inode_size (256) * inodes_count (0) too big for a
        filesystem with 0 blocks, specify higher inode_ratio (-i)
        or lower inode count (-N).

Here’s the partition info from sudo fdisk /dev/sdc using the p command:

Disk /dev/sdc: 146.8 GB, 146814976000 bytes
61 heads, 35 sectors/track, 134308 cylinders, total 286748000 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: 0x8b4573b5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   286747999   143372976    5  Extended

So I added that block count 143372976:

$ sudo mke2fs -c -L backups -t ext4 -T default -v -n /dev/sdc1 143372976
mke2fs 1.42 (29-Nov-2011)
fs_types for mke2fs.conf resolution: 'ext4'
Filesystem label=backups
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
8962048 inodes, 35843244 blocks
1792162 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1094 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Ok, looks good. However, when I remove «-n» to actually perform the action, it says Filesystem larger than apparent device size:

$ sudo mke2fs -c -L backups -t ext4 -T default -v /dev/sdc1 143372976
mke2fs 1.42 (29-Nov-2011)
mke2fs: Filesystem larger than apparent device size.
Proceed anyway? (y,n)

And when I enter y to proceed, I get a screen full of errors:

badblocks: Invalid argument during seek

What am I missing?

EDIT

Here are the contents of /etc/mke2fs.conf:

$ cat /etc/mke2fs.conf
[defaults]
        base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
        default_mntopts = acl,user_xattr
        enable_periodic_fsck = 0
        blocksize = 4096
        inode_size = 256
        inode_ratio = 16384

[fs_types]
        ext3 = {
                features = has_journal
        }
        ext4 = {
                features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
                auto_64-bit_support = 1
                inode_size = 256
        }
        ext4dev = {
                features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
                inode_size = 256
                options = test_fs=1
        }
        small = {
                blocksize = 1024
                inode_size = 128
                inode_ratio = 4096
        }
        floppy = {
                blocksize = 1024
                inode_size = 128
                inode_ratio = 8192
        }
        big = {
                inode_ratio = 32768
        }
        huge = {
                inode_ratio = 65536
        }
        news = {
                inode_ratio = 4096
        }
        largefile = {
                inode_ratio = 1048576
                blocksize = -1
        }
        largefile4 = {
                inode_ratio = 4194304
                blocksize = -1
        }
        hurd = {
             blocksize = 4096
             inode_size = 128
        }

Понравилась статья? Поделить с друзьями:
  • Mk9 ошибка out of memory
  • Mk9 runtime error r6025
  • Mk11 ошибка emp dll
  • Mk10 ошибка при запуске приложения 0xc0000906
  • Mk10 ошибка при запуске приложения 0xc0000142 как исправить