Software :: How Many 4096 Byte Blocks On Disk
Aug 13, 2011
I want to find out how many 4096 byte blocks there are on my disk. I used df -B 4096 and it gave me a number but I'm not sure it's correct as I can use dd to read past what should be the final block.
So I do df -B 4096 and it reports this result:
Code:
Filesystem 4K-blocks Used Available Use% Mounted on
/dev/sda1 15618840 13190294 1635137 89% /
But when I use dd to go past that block, it doesn't report an error or anything. The command I'm using is
Code:
dd if=/dev/sda1 bs=4096 count=1 skip=15618841
How can I know that I'm really reading the very last block on the drive?
View 2 Replies
ADVERTISEMENT
Jun 27, 2011
I am getting a new 4kb sector HDD for my laptop, WD scorpio black 750gb, I would like to image existing partitions on 512bytes sector HDD and move them to the new 4kb sector HDD, what's the best way to do this.
present config is as follows:
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
[Code].....
I am planning to keep the same three partitions as the primary partitions on the new drive and add few more logical partitions. I would have liked to move to GPT but since I need Win 7, I am stuck with MBR partiotion table.
Now, I understand how to partition an Advanced format disk, what I want to know is how to move the existing partitions on the 80 Gb disk to the new disk?
I use Clonezilla to copy partitions but it is not compatible unless both the target and the source disks are already using 4096 sector size.
I can use Acronis True Image WD Edition to clone Win 7 but how do I clone Ubuntu?
Also my Laptop's chipset is limited to SATA 1.5, will it cause any issues, I know the bandwidth is not an issue.
View 7 Replies
View Related
Dec 9, 2010
In the past I have been able to succesfully install ubuntu on several external usb drives with up to 500gb in size.Now I am trying to install a copy of ubuntu 10.10 on an external usb iomega 1tb eGo drive but I am having major issues.The installer reports the total disk size as only 124 gb, instead of the 998gb that gParted reports for the same disk. Proceeding with "use the full disk" installs ok, but it doesn't boot.Grub2 reports that it cannot find the kernel.After some desperate attempts to repartition and after some googling I think that the issue may be with the sector size, which fdisk -l reports as 4096kb (all my other drivers report 512kb) and I have the impression that linux is not ready for it (or I lack the knowledge, which seems more likely).I have also tried to install fedora 14. This distribution reports the correct disk size, installs properly, but again, it cannot boot (Fedora uses grub, not grub2), with a very similar message to the grub2 installer.Because of the way I work, I need my external usb drive to be able to boot linux. And I find it difficult to believe that linux doesn't handle 4096kb sector disks, so here I am asking for help . Please note I am not a linux expert.
View 3 Replies
View Related
Jul 6, 2011
I got across a peculiar problem with memcpy.History:writing a code which do flash/Read functionality for SPI Parts.
Implementation:
1.memory map the Flash chip registers to userspace. - fine
2.Issue block read command
3.Just print the data I got, using the memory mapped address - fine I got the correct data.
4.Copy the data to a local buffer from memory mapped address using memcpy - FAIL
UPDATE:
on SUSE 11.3 -32 bit the above code worked perfectly, but on SUSE 11.4 - 64bit , Ubantu, Fedora it failed.
I am using gcc compiler obviously. I am using i386/x86_64 OS. Processor: Intel core 2 duo, SNB after step 4 , when I dump the data from local buffer every thing is FF.But step 4, if i implement byte by byte copy using assignment operator, it worked.is there any known bug with memcpy? am I missing anything?
View 7 Replies
View Related
Feb 4, 2010
I'm setting up a mysql replication system. I usually maximize what's left on my stock before I buy. I do badblocks first to all 2nd hand hard drive to make sure it is in good condition before I install an Operating System.
I pick up a 200GB sata hard disk in the stock room and test it using badblocks. I left it in the office doing the test and just check it tomorrow. When I return to check, the report says it found 30 bad blocks.
View 2 Replies
View Related
Oct 13, 2010
My old system disk almost failed me. I dd_rescued the disk onto a new one (_don't_ use dd_rhelp, that one took days and seemed to forget what it had scanned more than once). The condition of the disk was not very good. So naturally I expected the subsequent fsck.ext3 to bomb half of the new disk. But obviously only a few inodes were affected and I lost only about 10 files completely (mostly on the root partition and not the home partition - yeay!).
However, I then ran a badblocks and put all the bad blocks into a file. I could use this to run fsck but I fear that
1. It could undo or even redo worse than what the first fsck run did, and
2. giving the list of bad blocks, fsck might on the one hand rescue/flag damaged files (which is what I want), but I don't want it to flag the bad blocks on the new disk as well (they are not bad blocks anymore, just copies of bad blocks).
So, how can I single out problematic files using my list of bad blocks (which I can then look at one by one if they could be rescued) without flagging the supposedly bad blocks on the new disk.
View 3 Replies
View Related
Mar 17, 2010
Let's say I'm using one of those PCs that uses a SSD flash drive in place of a more regular HDD.
Say I burn my favorite .iso distro and install it on this PC. I install my favorite applications and seek out and install any missing drivers and generally tweak the system like you do. When I am finally happy with it, I make an image of this installation to an external USB drive.
Now, say 9 months later some of those SSD blocks have gone bad because they were erased too often. They're no longer usable. Also, because I'm a sloppy person who can't be bothered to delete redundant stuff and run make-cleans and so forth, the disk is getting pretty cluttered and takes longer and longer to do stuff.
I decide the obvious solution is to remove and save any data I need to keep, then just over-write the disk with the image I made 9 months earlier.
The question is: will the firmware be smart enough to re-map my incoming image to avoid these bad blocks on the SSD? Or am I going to wind up with some parts of the image being located on bad areas of the SSD?
View 2 Replies
View Related
Oct 15, 2010
This has happened several times now, with 9.10 and 10.04. I back up my photos periodically to external drives, using Nautilus. At the next attempted login Gnome won't start and sometimes gives power manager incorrect installation error.
First time this happened I was stumped and eventually did a clean install. Second time, I found advice elsewhere in this forum to solve this by emptying root trash, which did the trick. This time, however, root trash has nothing in it and 2 users trash were insignificant (I emptied them all anyway with rm -r). Tried looking for enormous directories but couldn't find a smoking gun. I would rather not end up doing another clean install - a painful and extreme solution. I'm continuing to look for solutions to the immediate problem, but my question really is, what causes this and how do I prevent it in the future? I've run Computer Janitor regularly and ran apt-get clean but no help. Should I do all my large scale copying from terminal? I'm not a total noob, but close.
View 9 Replies
View Related
Apr 20, 2011
Is there any available Ubuntu encryption stronger than a 4096-bit DSA PGP key that is natively supported or can be supported by Evolution?
View 2 Replies
View Related
Jan 16, 2010
So when i install ubuntu it gets to 47% and than i get this error message. After that the install doesn't really seem to do much.Code:Device /dev/sbd has a logical sector size of 4096. Not all parts of GNU Parted Support this at the moment, and the working code is HIGHLY EXPERIMENTAL.Now i did search and i found another topic where someone had the same problem. His solution was to reburn the CD and try again. I did that and it still got me the same messageP.S. I do have two boot options now however. One for ubuntu and one for windows though i already ran the uninstall.
View 1 Replies
View Related
Jul 15, 2010
I'm a Ubuntu 9.10 user and have baught a WD 1.5TB HDD. When just formating it with gparted it's extreemly slow! I have read that with gparted 0.51 there are ways to get this harddrive to work correct but there are no 0.51 packages available for 9.10.
View 9 Replies
View Related
Apr 30, 2010
I'm going to replace damaged HDDs in my server with new drives, which have sector size of 4096 bytes instead of 512. Does CentOS natively support such drives? If yes, since which version? If no, what actions should I take to correctly prepare such a drive to work. How to check that such a drive is correctly recognized by OS?
View 3 Replies
View Related
Feb 9, 2011
create a large buffer in my program so that I can send, and then receive on another pc, more than 4096 bytes (this seems to be the default for the serial port). I thought this might work:
[code]...
View 9 Replies
View Related
Nov 24, 2010
I'm learning C and trying to write a program to convert gigabyte into byte. It will take 50% of the value given and then convert that value into byte. But the problem is the output goes into minus / negative value. Like, if I enter 22, I get output: -2147483648.
Code:
#include <stdio.h>
#include <math.h>
main (int argc, char* argv[])
{
[Code]....
View 5 Replies
View Related
Jul 10, 2011
As 2.17
I want to code this:
and byte[45],03
In words, AND the byte at memory location 45 with immediate value 03. As reports "Ambiguous operand size for and". How could I code the instruction such that as understands my intention?
john: .byte 45
and byte[john],03
gives the same error.
View 8 Replies
View Related
Jun 3, 2011
i play around with c for producing some io to a san-disk and struggle with basics here. :-(
if i'm using the write()-call to write 1 byte to a file on the disk iostat tells me i'm producing 3 writes. if i write 1 byte twice a second, it tells me i produce 6 writes (w/s).
View 8 Replies
View Related
Jun 11, 2010
E.g. 98 is represented as 1100010 (number of valid bits is 7)
What is the formula to calculate the number of valid bits in a byte ?
View 14 Replies
View Related
Dec 11, 2010
Code:dd if=/dev/sda bs=1 count=2048 of=johnIs there a linux tool to search for a sequence of bytes within john? E.g., to look for 0x6a84b5fe78 ?
View 6 Replies
View Related
May 17, 2010
I am running ubuntu 9.10 and was wondering how to disable write access in python. I want to stop .pyc extensions from saving every time I run a .py file.
View 3 Replies
View Related
Sep 3, 2010
how to search in files text that is one-byte encoding? places - search for files in gnome in ubuntu searches only utf-8 text.i know one way: install wine and total commander, then search with it. what are better ways?[URL]
View 4 Replies
View Related
Nov 5, 2009
I have a file that stores employee login IDs, names, types, and permissions. Our software reads the information based on byte-columns, so it reads a column as any ASCII character (spaces, letters, numbers, punctuation, etc.). I want to create a web-interface for adding and removing users, and storing the data in a MySQL database. However, if I am creating the files from the MySQL output, I need a way to write to specific column locations in the file ...
User ID: Columns 1-4
User Name: Columns 6-30
Type: 32-40
Permissions: 42-45
I want to use a scripting language, preferably C-Shell, to call MySQL for the data and write the data to the correct columns of the file. I wrote a script that takes the data from the file, and dumps it into the MySQL table, so maybe I can pad the remaining space in the table column to fill with spaces ...
View 12 Replies
View Related
Aug 12, 2010
I'm trying to write an extension to PHP which means coding in C. I'm really really rusty at C coding and was never very good at it.
Can anyone propose an efficient, safe, and [hopefully] future-proof way of reversing a double? Keep in mind that it should work on as many systems as possible and on 32- and 64-bit systems (and on ???-bit systems in the future?). Will the size of a 'double' ever change or will it always be 8 bytes?
I've tried this and it doesn't work...the compiler complains about "invalid operands to binary" because I'm trying bitwise shiftw on a non-integer.
Code:
x = (x>>56) |
((x<<40) & 0x00FF000000000000) |
((x<<24) & 0x0000FF0000000000) |
((x<<8) & 0x000000FF00000000) |
[Code]....
View 3 Replies
View Related
Oct 26, 2010
I need to convert an integer to a byte array of size 2 and vice versa. The code shown below works well for positive values but not for negative values. Also, using an array of size four makes the conversion works. However, I am limited to an array of size 2.
View 5 Replies
View Related
Feb 7, 2011
I'm sniffing network packets in ubuntu, I need to write these packets as raw bytes to memory but libpcap give packets in its special format. how can i save and recover packets in byte format?
View 2 Replies
View Related
Jun 16, 2010
I am trying to learn assembly using nasm as assembler. I did not found example related to string operation. I had following example code,
global asm_strlen
section .data
section .bss
section .text
[code].....
my problem is at highlighted line, I am not getting how to copy a byte into 4 byte reg. rather what is syntax of mov instruction to mov byte to WORD DWORD etc.
View 3 Replies
View Related
Jan 13, 2010
im trying to send pages of 4096 bytes from kernel layer of server to kernel layer of client over a network. previously i tried the foll. code , for data less than a 100 bytes it worked fine , but for something larger than that the computer hangs......(even the dmesg's wont say why) i also wanted to know how we could use the 'sendpage' function to solve this problem.
Code:
CLIENT'S KERNEL MODULE
struct iovec iov;
char buf[1024];
[code].....
View 1 Replies
View Related
Nov 17, 2009
Ive installed Gaussian '03 on fedora Core 10, but I'm unable to run it. It aborts and i get the following error
Code:
Erroneous write during file extend. write -1 instead of 4096
Probably out of disk space.
Write error in NtrExt1
View 3 Replies
View Related
Jan 11, 2013
Assuming there are two list objects a1, a2.
a1 = ['
']
a2 =['hi
']
len() built-in function gives total number of elements in the list object.
len(a1) gives 1. len(a2) gives 1 also.
Code: Select all$ python
Python 2.7.3 (default, SepĀ 9 2012, 17:41:34)
[GCC 4.7.1] on linux2
[Code]......
I thought there exists a built-in function that gives total size of a list object in byte. So using the function produces 1 for a1, 3 for a2. I haven't found such function or module yet.
View 3 Replies
View Related
Jan 15, 2011
At present I have to live with a 5Gb/month data volume limitation. Due to having to monitor this usage, I have been forced to use the software that came with the web dongle - and that means having to use Windows (spit!)
Can anyone recommend a Linux package I could download that readily shows how much data one has uploaded/downloaded over a set period?
View 3 Replies
View Related
Jun 27, 2010
I have to get soem statistic about interfaces from /proc/net/dev. but statistic on this file is reset when get reach more than 4G byte.I think linux has limitation on this case.
View 1 Replies
View Related