Tag Info

Hot answers tagged

31

Another option is to use blkid: $ blkid /dev/sda1 /dev/sda1: UUID="625fa1fa-2785-4abc-a15a-bfcc498139d1" TYPE="ext2" This recognizes most filesystem types and stuff like encrypted partitions. You can also search for partitions with a given type: # blkid -t TYPE=ext2 /dev/sda1: UUID="625fa1fa-2785-4abc-a15a-bfcc498139d1" TYPE="ext2" /dev/sdb1: ...


25

You can use sudo parted -l [shredder12]$ sudo parted -l Model: ATA WDC WD1600BEVT-7 (scsi) Disk /dev/sda: 160GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 8587MB 8587MB primary ext3 boot 4 8587MB 40.0GB 31.4GB primary ext4 2 ...


25

How do I tell what sort of data (what data format) is in a file? → Use the file utility. Here, you want to know the format of data in a device file, so you need to pass the -s flag to tell file not just to say that it's a device file but look at the content. You'll see output like this: # file -s /dev/sd* /dev/sda1: Linux rev 1.0 ext4 filesystem data, ...


21

check with lsof if there are files held open, space will not be freed until they are closed sudo /usr/sbin/lsof | grep deleted will tell you which deleted files are still held open


11

use lsof to find the deleted, but open, file still consuming space lsof | grep deleted | grep etilqs_1IlrBRwsveCCxId chrome 3446 user 128u REG 253,2 16400 2364626 /var/tmp/etilqs_1IlrBRwsveCCxId (deleted) find the entry in /proc//fd/ that cooresponds to the filehandle ls -l ...


11

The man page of tune2fs gives you an explanation: Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. It also acts as a ...


11

I guess you got that one letter into the file with echo a > file or vim file, which means, you'll have that letter and an additional newline in it (two characters, thus two bytes). ls -l shows file size in bytes, not blocks (to be more specific: file length): $ echo a > testfile $ ls -l testfile -rw-r--r-- 1 user user 2 Apr 28 22:08 testfile $ cat -A ...


10

The -T largefile flag adjusts the amount of inodes that are allocated at the creation of the file system. Once allocated, their number cannot be adjusted (at least for ext2/3, not fully sure about ext4). The default is one inode for every 16K of disk space. -T largefile makes it one inode for every megabyte. Each file requires one inode. If you don't have ...


10

Still another way, since you know you're running some flavor of ext?, is to look at the filesystem's feature list: # tune2fs -l /dev/sda1 | grep features If in the list you see: extent — it's ext4 no extent, but has_journal — it's ext3 neither extent nor has_journal — it's ext2 The parted and blkid answers are better if you want ...


9

No. ext3fs doesn't support block fragmentation so a one byte file will use a whole 4096 block. On the opposite, for example UFS supports four fragments in a block so small files won't fill a file system as fast as they will do on ext3fs. This is unrelated to disk fragmentation which is about file data blocks not being contiguous and sequential.


9

I think you're confused, possibly because you've read several documents that use different terminology. Terms like “block size” and “cluster size” don't have a universal meaning, even within the context of filesystem literature. Filesystems For ext2 or ext3, the situation is relatively simple: each file occupies a certain number of blocks. All blocks on a ...


9

These days ext4 is considered the stable standard, and you should use it. Also all filesystems use delayed writing, ext4 just delays allocating where the blocks go until they are actually written, which helps reduce fragmentation. It also uses extents to track the blocks, which makes it more efficient.


8

Try a differfent program; maybe this will be more accurate: df -h


7

To add to the other answers: Traditional Unix permissions are broken down into: read (r) write (w) execute file/access directory (x) Each of those is stored as a bit, where 1 means permitted and 0 means not permitted. For example, read only access, typically written r--, is stored as binary 100, or octal 4. There are 3 sets of those permissions, which ...


7

You can use a tool like PhotoRec to read the blocks and try to recover files. It actually recovers a lot of file types, not just images like the name may suggest. http://www.cgsecurity.org/wiki/PhotoRec


7

That's one of the most advertised benefits of ext4 (see it mentioned in the Features on Wikipedia). The reason? Filesystem developers worked hard to achieve this. Here's a short summary quoted from Wikipedia: Faster file system checking In ext4, unallocated block groups and sections of the inode table are marked as such. This enables e2fsck to ...


7

First, you're right to suspect that “all data” doesn't mean the whole file. In fact, that layer of the filesystem operates on fixed-size file blocks, not on whole files. At that level, it's important to keep a bounded amount of data, so working on whole files (which can be arbitrary large) wouldn't work. Second, there's a misconception in your question. The ...


7

reduce reserved space to 4% # tune2fs -m4 /dev/sda4 df -h now showed 45M free. Saved my files quickly Put it back to 5% # tune2fs -m5 /dev/sda4


6

On an ext4 filesystem (like ext2, ext3, and most other unix-originating filesystems), the effective file permissions don't depend on who mounted the filesystem or on mount options, only on the metadata stored within the filesystem. If you have a removable filesystem that uses different user IDs from your system, you can use bindfs to provide a view of any ...


6

Actually yes. Since ext2 and ext3 are fairly similar, with the major difference being ext3 supports journalling, you should be able to: tune2fs -j ./system.img Which enables journalling. The conversion process is detailed here with the usual disclaimers about important information, messing with filesystems etc. You can actually go back to ext2 too, if ...


6

If you want to ensure fragmentation but not prevent it (so you only have partial control over what happens), and you don't care about the specifics of the fragmentation, here's a quick & dirty way of doing things. To create a file of n blocks in at least two fragments: Open the file with synchronous writes, write m < n blocks. Open another file. ...


6

You run e2fsck -D on the unmounted filesystem.


6

The purpose of reserving a small number of blocks for root's use only is to give root a chance to log in and give them a little bit of breathing room to make space in case the disk becomes completely full. Without it, root could be prevented from logging in because the login process fails when it gets unexpected errors writing files (like utmp and wtmp, ...


6

try using df -T see man df for more options still one more way I found is cfdisk


6

Because, if you mount the ext3 in writable mode, there are a few things that get updated, like the last mount date. Try if this also happens when you mount with -o ro.


6

The good thing about linux is the source is always somewhere. You can download or view the base e2fsprogs sources on kernel.org. This can also depend on your specific version and distribution though... From current code it looks like it's some value added to 20 based on the UUID of the partition, if you have enable_periodic_fsck = 1 in your mke2fs.conf ...


6

Don't get misled by the fact that only writeback mentions internal filesystem integrity. In ext3, whether you use journal, ordered or writeback, file system metadata is always journalled and that means internal file system integrity. The data modes offer a way of control over how ordinary data is written to the file system. So, if data integrity is your main ...


6

It can be partially accomplished by piping the grep command to lsattr command. lsattr -R | grep +i However, I believe when you mention the entire ext3 file system the search might involve /proc , /dev and some other directories which if reports some error you just want to ignore. You can probably run the command as, lsattr -R 2>/dev/null | grep -- ...


5

First I would double check that the disk is structured as you think it is from a partitions perspective. Typically the command: $ fdisk -l /dev/sdb For example: $ sudo fdisk -l /dev/sda Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size ...


5

After looking at the code for various utilities and the kernel code for some time, it does seem that what @Hauke suggested is true - whether a filesystem is ext2/ext3/ext4 is purely defined by the options that are enabled. From the Wikipedia page on ext4: Backward compatibility ext4 is backward compatible with ext3 and ext2, making it possible to ...



Only top voted, non community-wiki answers of a minimum length are eligible