0

I'm working on a computer with very little memory (128MB) - for my application I need to format large drives (4TB)

I'm able to format greater than 2TB disks, up to about 2.5TB, but beyond that I'm given the below

mke2fs 1.42-WIP (16-Oct-2011)
/dev/sda1: Memory allocation failed while setting up superblock

I realize I'm really out there in terms of reasonable - are there any tricks? (block sizes, etc)

any idea how I can get very large disks to format?

stuck
  • 667
  • 2
  • 10
  • 23

2 Answers2

1

Add some swap: http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
mkswap /swapfile1
swapon /swapfile1

That'll make 512MB of swap and enable it. You'll need to edit your /etc/fstab to make it stay after a reboot, though.

Jay
  • 6,439
  • 24
  • 34
1

An even better approach would be to use the -D flag. From the man pages:

 Use direct I/O when writing to the  disk.   This  avoids  mke2fs
 dirtying  a  lot  of buffer cache memory, which may impact other
 applications running on a busy server.  This option  will  cause
 mke2fs  to run much more slowly, however, so there is a tradeoff
 to using direct I/O.

Worked for me with an initramfs and 512MB.

Nate
  • 21
  • 2