Create A Large File In Linux

I want to create a large file size lets says 600G. I used command
# fallocate -l 600G file01
Although I got the file of my size but the things is, there is no data. I want to create a file with size 600G and random data in it.

Any suggestion?


Similar Content



How To Create Large Size File With Some Random Characters And Numbers?

Can anybody tell me how to create large size file in linux? I am using truncate but it is not creating files with some random characters ad numbers.
Please suggest me commands with syntax and example to create large size file with some random characters and numbers in linux with proper explanation.
Thank You.

Installing CentOS 6.5 To Multiple VHDX's On Hyper-V 2012. Is It Possible?

Hello all

I am trying to create a Hyper-V 2012 Virtual machine running Cent0S 6.5 for a client. Currently I have the VM set up with two SCSI disks one of size 25GB and one of size 60 GB.. The 25 GB disk will be the OS disk and the 60 GB disk will be the data disk which holds the data from the database. I want to create an LVM on the 60 GB disk and increase it over time as the database gets bigger. As soon as the disk gets to about 1 TB, I will create a third disk, and extend the Volume Group to include that third disk as well. The third disk will eventually grow past 1TB as well (but not 2TB)

Overall my question is, would this type of set up be possibly using a MBR Bios set up? or would I HAVE To use GPT?

all help is greatly appreciated!

How To Shrink A Large Audio Ogg File

I would like to learn how to create a zip file. The word zip file is a Windows/Microsoft word. I do not know what word is used in Linux OS.
What I am trying to do is send a copy of an internet radio show. The show is two hours long. When I try to attach the audio file to an email. I am told the file is too large.
I have permission from the host of the radio show to make a copy and send it to a friend.

Calculating File Sizes From Indoors And Blocks

Hello I have this problem, but I just ant to know if I am on right track:

Quote:
i_addr is an array of 15 pointers which hold the addresses of a direct data blocks and single indirect, double indirect or triple indirect block.
The first 12 elements of the array refer to addresses of blocks on the disk, which actually contain the files data. When a file requires more than 12 direct blocks, the file system must use disk blocks to hold the addresses of the remaining data blocks needed. These are called indirect blocks. In this particular file system the inode holds the addresses of three indirect data blocks in addition to the 12 direct data blocks discussed. There are single, double and triple indirect data blocks. There is one of each. (in total there are 15 references in the inode). A single indirect block (referenced by element 12 of the inode array) holds the addresses of 2048 disk blocks.
If the file consumes more blocks then can be referenced by a single indirect block then the file system uses a double indirect block. (referenced by element 13 of the inode array). A double indirect block can hold the addresses of 2048 indirect blocks.
If the file consumes more blocks then can be reference by direct, single and double indirect data blocks then the last element of the inode array is used to hold a triple indirect block which effectively references a number of double and single indirect block (ultimately the data).
The Questions I attempted

Quote:
Given the block size of the file system is 8192 bytes answer the following questions:
1. Whatisthemaximumpossiblefilesizethatcanberepresentedviadirectdatablocks?
2. What is the file size if each element of an indirect data blocks references a data block and all direct blocks are used?
3. Whatistherangeoffilesizesthatwouldrequiretheuseofadoubleindirectblock?
4. Whatisthemaximumfilesizeinthisfilesystem?
5. How much overhead is incurred by the file system to store a file of 8437760 bytes.
Overhead is size in bytes of the number of blocks needed to reference this object i.e. indirect blocks etc.
My answers:

Quote:
Answer 1) we know 1 block=8192 bytes, and there are 12 direct data blocks so the max. size is (12*8192) bytes = 98304 bytes.

Answer 2) file size will be = file size in direct data blocks + (2048*8192) = approximately 17 MB

Answer 3) The starting range is > 17 MB. The maximum range will be (2048*8192) + (2048*8192) =

Answer 4) Max size of file in this file system is = 98304+(2048*8192)+(2048*8192)*2+(2048*8192)*3=84.33 MB

Answer 5) We know first 12 blocks have 98304 bytes. The single indirect block has 2048*8192 bytes. Given 8437760 bytes of file size we have an overhead of (2048*8192)/(8437760-98304)= 2 bytes
Please correct me and why am I wrong.

Thanks

Removing Multiple Lines From Cell Data In A .csv File

I am trying to process some .csv files with Linux as follows:

Some fields have data with newline characters embedded, like so:

"Bob Smith
531 Pennsylvania Avenue
Washington, DC"

(I verified the existence of the " via Wordpad. The file is too large to easily edit in Wordpad to get all the data for each row on a single line).

what linux command would I use on the files to get the data in each cell on one line?

I have tried:

1. awk -v RS="" '{gsub (/\n/,"")}1' file > newfile

but the cell data was still being read in as if "531 Pennsylvania Avenue" was a brand new row in the CSV file.

2. Command 1 followed by awk -v RS="" '{gsub (/\r/,"")}1' newfile > finalFile

but that resulted in all of the data in the file being put onto a single line.

3. awk -v RS="" '{gsub (/\r\n/,"")}1' file > newFile

But that result was the same as attempt number 2.

How can I preprocess the file so that:

"Bob Smith
531 Pennsylvania Avenue
Washington, DC"

is read as a single field on a single line as part of the row it should be associated with, like

"Bob Smith 531 Pennsylvania Avenue Washington, DC"

Write To Pipe File Hangs (using Echo Command)

HI,

I am a newbie to Linux and am trying to create a pipe file with the below command:

mkfifo pone

Now I am trying to write data to the file with the following command on the command prompt:

echo asdadsasdasdasdasdasd >./pone

But after i enter this command- the screen hangs up and doesnt proceed ahead.
Same thing happened when I tried writing using:
gedit pone


Can anyone help me resolve this issue?

Diffing The Line Numbers

hi guys

i am trying to find the "size" of a "block" of data in LARGE data files, the example below test_data.txt is very simplified. by "size" i mean the difference in line numbers of a block, and the "size" will be constant throughout the file so

1234 6.600000 4321
1234 8.500000 4321
1234 1.800000 4321
1234 2.300000 4321
1234 8.500000 4321
1234 2.800000 4321

if i define a block as whenever i find 8.500000 in the second column, then in the example the the block size would be 3 becasue 8.500000 occurs on the 5th line and on the 2nd. right now i am using

Code:
 grep -n "8.500000" test_data.txt | cut -f1 -d:

and/or

Code:
 awk '/8.500000/ {print FNR}' test_data.txt

obviously i don't remeber how to tag text as code?

btw, the grep command is much much faster

both of these commands give an entire list (long list of number for files greater than a gig) of line numbers which i then have to subtract one from another to come up with 3 in the example. not that i'm opposed to doing math, but i would think awk or grep should be able to do this for me

ideas?

tabby

Please Help Me To Start My DNS Server Logging.

I am facing problem in enabling the DNS Log making in named.conf file.
My /etc/named.conf file structure is as follows:
-------------------------------------------------------------
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
listen-on port 53 { 127.0.0.1; 10.40.124.2; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 10.40.124.2; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
};

logging {
channel default_debug {
file "/var/log/named.run";
severity dynamic;
print-time yes;
};

channel queries_channel {
file "/var/log/queries.log";
severity dynamic;
print-time yes;
print-severity yes;
};
channel security_channel {
file "/var/log/security.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

channel update_security_channel {
file "/var/log/updates.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

channel dnssec_channel {
file "/var/log/dnssec.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

channel xfers_channel {
file "/var/log/zone_transfers.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

category queries { queries_channel; };
category security { security_channel; };
category update-security { update_security_channel; };
category dnssec { dnssec_channel; };
category xfer-out { xfers_channel; };
};
zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
----------------------------------------------------------------
My DNS Server works fine. Only it cannot make the log.
when I will run this command:
#dig -x 10.40.124.2
the result comes fine but the log is not make in /var/log/queries.log file.
The named is running without chroot enviroment.
Please help me in solving this.

Cannot Execute Binary File

hello everyone,
I created a script file (info.sh) in linux centos 6.
location of file is '/etc/init.d/info.sh'
content of file is:

#!/bin/sh
#To get the MAC address
ifconfig | grep HWaddr
#To get the HDD serial no.
hdparm -I /dev/sd? | grep 'Serial\ Number'
#To get the HDD size
hdparm -I /dev/sda |grep "device size"

gave the permission by: chmod 777 /etc/init.d/info.sh
but when i run this file by: /etc/init.d/info.sh
it gives an error like...
-bash: /etc/init.d/info: cannot execute binary file

what should i do?? Actually i have to run this file during boot up..

thanks in advance..

Incorrect Disk Space Of External Disk

I have an external disk connected to a raspberry pi to act as a nas, which I am accessing from a linux mint desktop machine.
The nas disk is 30GB, but according to my desktop machine, which connects through the file browser via samba, only around 318MB are reported as available.
If I try to copy a 400MB file it tells me there is insufficient space.
The disk is currently empty, so all 30GB should be available.

On the nas box, cfdisk seems to report the disk size and the partition size correctly:
Code:
                          cfdisk (util-linux 2.20.1)

                              Disk Drive: /dev/sda
                        Size: 30016659456 bytes, 30.0 GB
              Heads: 64   Sectors per Track: 32   Cylinders: 28626

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    sda1        Boot        Primary   ext4                             30016.66*

I'm not sure where to look next.