General :: Overwriting The Middle Of A File From A Block Device *without* Truncating File?
Jan 15, 2010
I have a Linux (Kubuntu) system with a large (~20Gb) file which I would like to mess with. Specifically, I want to copy the entire contents of another large file (~12Gb) to the middle of this file, and keep the bits of the file which are not overwritten.This is what I want to happen, with the text between the pipes representing file contents:Before:
outfile: |abcdefghijklmnopqrstuvwxyz|
infile: |123456789|
After:
[code]....
View 1 Replies
ADVERTISEMENT
Apr 19, 2011
I have a .txt-file with ~50.000 lines of numbers, generated by a mathematics program. From this file, I need line ~ 1.100 to line ~16.000 (these lines are always the same btw, this may make the solution easier, dunno) to be copy/pasted to another file, where the lines ~500 to ~15.000 (also, every time the same) should be overwritten by the aforementioned lines...I haven't found or come up with anything that works yet, mostly I find solutions to copy everything from one file to another but I can't find something to specifically overwrite a part of a file with part of another.
View 4 Replies
View Related
Apr 23, 2011
I have a huge log file of around 3.5 GB and would like to sample random sections in the middle of say 10 MB for the purpose of debugging what my application is doing.
I could use head or tail commands to get the beginning or end of the file, how can I grab an arbitrary portion from the middle of the file? I guess I could do something like head -n 1.75GB | tail -n 10MB but that seems clumsy and I'd need to determine line numbers for the midpoint of the file to get 1.75GB and 10MB line counts.
View 2 Replies
View Related
Sep 6, 2010
I'm facing difficulty while writing to an already existing file . I'm making a shell (programming in C). I want a file (say , logfile) to keep a record of all the commands a user enters. For the first command it runs fine , but for the second time and thereafter it overwrites the previous contents. How do I avoid this?
View 3 Replies
View Related
Sep 8, 2010
Everything in Linux is a file, right? And everything can be represented by a file? Is there some way I could create a block device file that represents (i.e., provides an interface to) this image file? If so, then I could use fdisk on the device file to split it into partitions, format the partitions, and then mount them as directories. I could create a file system within a file system, which would be fun.
View 2 Replies
View Related
Sep 12, 2010
the message on the title only happens with Ubuntu. In Fedora, it just stops booting from LiveCD with "WARNING: Cannot find root file system!". The rest of the symptoms are the same.I'm trying to install Fedora LiveCD on an IBM i Series notebook (model 1161-21X). It's a Celeron powered unit with RAM expanded to 512MB. It has a 10GB HDD, and an internal CD-ROM drive. Although it has two USB ports (1.1), it cannot boot from a USB drive, so no pendrive nor external CD unit solution possible.When I boot from LiveCD, it stops booting with the message above. Looking atsg, there's no CD-ROM driver loaded. Also, there's a char device for sg0, but no block device for it, so no way to mount it. It seems that the driver module has been removed from the kernel. I'm currently running Fedora Core 5 in it. This very same problem happens with any Ubuntu newer that 6 or any Fedora post 7.
View 2 Replies
View Related
Oct 5, 2010
I want to overwrite a set of files with the character "0" in order to delete their contents. For individual files I can do -
Code:
However for multiple files in a particular directory if I try the following -
Code:
The files are not getting overwritten.
View 4 Replies
View Related
Aug 23, 2011
I've bought an X10 Home Automation USB interface: the CM15.
This is the information lsusb gives:
skerit@KIP-DU-SKER:~$ lsusb Bus 008 Device 002: ID 0bc7:0001 X10 Wireless Technology, Inc. ActiveHome (ACPI-compliant)
But this tells me nothing about where the device file is! How can I find that, or create one myself?
View 1 Replies
View Related
Feb 28, 2010
How can I retrieve the block number(s) of a certain file in a file system (the blocks the file is using on the harddisc)?
I'm using the gentoo linux based SystemRescueCD, so I got plenty of tools installed which might get that information for me.
View 1 Replies
View Related
Jul 12, 2010
My Redhat Enterprise Linux 4 with 6x partitions (/, /boot,/home, /usr, /var, /tmp) of 6.0 GB IDE Hardisk was working quite fine. I decided to create LVM on /home and /var partitions but due to some errors occured and I delete the /home partitions. That's why partition table altered. I then delete 4,5,and 6th partitions (/home, /var, /tmp) partitions and now try to create one by one but following error is coming:-
[Code]....
The Super block could not be read or do not describe a clear ext2 file system. E2fsck b 8193 <device> I have tried following commands,but could not successful:- e2fsck -p /dev/hda7 (where hda7 was created but afterthat it was deleted) e2fsck -a /dev/hda7
View 2 Replies
View Related
Jun 4, 2010
Is there a way to set up KDE4 Konqueror so that middle click opens a file like in KDE3? In KDE3 Konqueror, middle clicking on a particular file would have the same effect as double clicking on it.
View 7 Replies
View Related
Jul 18, 2011
I have installed a new device in linux.If I enter lspci, i can see the information of this device.But, I donot which file in dev is mapped to this device.
View 2 Replies
View Related
Apr 27, 2010
Now I connect usb keyboard to my machine, and I would like to know how I can get device file name of this usb keyboard. I know it is /dev/input/event# file,but which event# file? I tried to do [dmesg | grep usb] , but kernel message don't tell me what I would like to know.
View 1 Replies
View Related
Oct 1, 2010
Device/Special file Clairification Requested.I'm reading a short article on Device/special files because it is related to VFS. This article has this paragraph that has to many pronouns in it to get an understanding of. URL..."In short, a device file (also called as a special file) is an interface for a device driver that appears in a file system as if it were an ordinary file. This allows software to interact with the device driver using standard input/output system calls, which simplifies many tasks."
What does a Device file have to do with the Application and the Driver communicating? Wouldn't the order of data transfer be , Application to driver and then to Device file?
View 3 Replies
View Related
Jan 7, 2010
here we have an older digicam (Jenoptik/Exakta Model "DC 22", if someone might want to know) that can be switched between some "PC Camera mode" and "Mass storage mode".Unfortunately, if attached to USB, it is always recognized as
Code:
UDEV [1262910483.475886] add /class/video4linux/video0 (video4linux)
lsusb tells:
[code]...
View 4 Replies
View Related
Jun 1, 2010
I want to test LVM+Raid. When I was testing ZFS on Solaris, I was able to create regular files, and use those as disks for testing.I tried creating a regular file full of zeros w/ dd, then partitioning that. fdisk seemed to be able to create a partition on the regular file, but mkfs and parted couldn't work with it. Is there any way to create fake block devices for testing?
View 4 Replies
View Related
Jun 14, 2010
When I try to mount the /dev/sdd1 device then it give errormount -t ext3 /dev/sdd1 /4hdmount:/dev/sdd1 is not a valid block device
View 9 Replies
View Related
Jun 19, 2010
Found the below from RedHat Knowledgebase
The Completely Fair Queuing (cfq) scheduler in Red Hat Enterprise Linux 5appears to have worse I/O read performance than in version 4. It appears as though the Completely Fair Queuing I/O scheduler (cfq) has a regression and thus exhibits reduced read-side throughput which can affect performance for both local and NFS mounted file systems.
One way to mitigate this is to set the cfq's slice_idle parameter to zero. To change this value, execute the following command echo 0 > slice_idle in the /sys/block directory appropriate for your situation, as shown below:
echo 0 > /sys/block/hda/queue/iosched/slice_idle
We are using NFS file systems in RHEL 5.3. I would like to know how to find which /dev/Device is being used by the NFS file systems, so that I could try setting the slice_idle to '0' to see if there is any difference in performance? In /etc/fstab I only see the actual NAS volumes for the NFS file systems.
View 2 Replies
View Related
Jan 28, 2011
I'm working on a midrange NAS system basically running on Linux and I got to do some great testing today. The step-by-step lead me to using fsdb to corrupt the magic number on a file system in order to corrupt it / test the script that should fix it.
View 1 Replies
View Related
Nov 2, 2009
* I am implementing mass storage device on a test board.
* It contains NAND flash.
* Using corresponding "udc driver" and "g_file_storage" I could make my test board enumerate as mass storage device on my Linux machine.
* my 16 MB pen drive (test board) is now ready for read/write.
But there are some Bad Blocks on the NAND.Hence copy is not complete. Although on Linux machine there is no error message. Now , what is there in a normal pen drive which manages the Bad Block or what am I missing so that such Bad Blocks are managed.
Here is the error I get on my test board :
mtdblock: erase of region [0x2c0000, 0x4000] on "Bon 2" failed
end_request: I/O error, dev mtdblock2, sector 5664
Buffer I/O error on device mtdblock2, logical block 708
[code]....
View 3 Replies
View Related
Apr 6, 2010
i have generated .exe file from C file (ie filename.c ) after compiling in linux machine with -O option. I wish to know about how to run that .exe file when linux system starts up ?
View 3 Replies
View Related
Feb 3, 2016
Is it possible to block download file from sambashare folder ?
For example pdf file frem debianInfo est.pdf I wat to provide only for read from this share.
View 9 Replies
View Related
Sep 26, 2010
Let's say I have a joystick in `/dev/input/js0`, how do I find out which device is it on `/sys/bus/usb/devices/`?
View 2 Replies
View Related
Nov 7, 2010
I want to convert fdf file to xsf file or xyz file on ubuntu 9.10_32 bit .
View 5 Replies
View Related
Aug 4, 2009
i am using now the squidproxysome tutorials i followedwhat i want is to restrict downloading of any exe file, mp3, even a video extensionsince my squidproxy running some exe is blocked for example i just want to download pidgin.exe and its giving me an information that i have no rights to download but on this site rlook-fing-1-2this exe i can able to download and i dont know why?
View 3 Replies
View Related
Jan 25, 2010
i have written block driver. its got registered succesfully.now i want to perform file opration like opening file reading/writing data into file which is stored into device.fter registration device node is created under /dev/xxx i am not getting, through this node how to open file which is stored in device.from one document i came to know that i have to use filesystem but in that doc how to use filesystem is not explained
View 4 Replies
View Related
Apr 24, 2010
I need to monitor file reads&writes by all the apps. I have found a kernel feature /proc/sys/vm/block_dump. But it only gives me block numbers while i would like to know file names. How can i convert these block numbers to file names (if the blocks belong to a file, of course)?
View 3 Replies
View Related
Nov 22, 2010
I have a log file and want to extract all blocks of text that start with START and ends with END. Each block is 5 lines.
Code:
--- START
blah blah blah
[code]...
View 1 Replies
View Related
May 11, 2011
I have one hard disk (call her HDA) that contains nothing but a single ext4 partition containing a backup of all my important data. Last night I did a clean install of Ubuntu 10.10 on my primary hard disk (call her HDB) and from there proceeded to upgrade directly to Ubuntu 11.04 upgrade. In 10.10, I was able to read HDA just fine. However after the upgrade, I can no longer mount this drive. When mounting from file browser:
Code:
Error mounting: mount: wrong fs type, bad option, bad superblock on /dev/sda,missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so The end of dmesg said the following:
Code:
dmesg | tail
[ 82.130904] EXT4-fs (sda): bad geometry: block count 122096646 exceeds size of device (122096381 blocks)
my hard disk has a block count greater than the size of my device. I've done my background searching on this and tried a command line utility I've never heard of before:
Code:
# sudo e2fsck /dev/sda
e2fsck 1.41.14 (22-Dec-2010)
The filesystem size (according to the superblock) is 122096646 blocks
The physical size of the device is 122096381 blocks
[code]....
this is as far as I've gotten. This drive holds over a decade's worth of work for me and is extremely valuable. I really didn't think that the Ubuntu upgrade process would mess with this drive, seeing as the Ubuntu install was contained on an entirely different drive. What is it that I need to do to restore my drive to working status?
View 9 Replies
View Related
Mar 10, 2011
I had found the following error messages one of my Linux server. the file system using for this partition is EFI GPT. Is this cause because of RAID controller incompatibility or Driver mismatch? PHP Code:
[Code]..
View 2 Replies
View Related