Difference between revisions of "FileSystems"

From Alessandro's Wiki
Line 12: Line 12:


== SSD ==
== SSD ==
 
* ssh drives behave differently from disks, to allow proper use of the TRIM command in delete operaions, I must use ext4 and enable this feauture in the /etc/fstab file:
* ssh drives behave differently from disks, to allow proper use of the TRIM command in delete operaions, I must use ext4 and enable this feauture in the /etc/fstab file:
  /dev/sda1  /  ext4  rw,defaults,discard 1 1
  /dev/sda1  /  ext4  rw,defaults,discard 1 1



Revision as of 16:31, 25 September 2011

Sizes

Kilobyte - KB	1024 Bytes
Megabyte - MB	1024 KBs
Gigabyte - GB	1024 MBs 
Terabyte - TB	1024 GBs
Petabyte - PB	1024 TBs
Exabyte - EB	1024 PBs
Zettabyte - ZB	1024 EBs
Yottabyte - YB	1024 ZBs


SSD

  • ssh drives behave differently from disks, to allow proper use of the TRIM command in delete operaions, I must use ext4 and enable this feauture in the /etc/fstab file:
/dev/sda1   /   ext4   rw,defaults,discard 1 1

ext2

  • basic old non-journalized linux filesystem

ext3

  • the officialjournalized Linux file system

crypt

  • I use dm-crypt with sys-fs/cryptsetup

ext4 (not ext4dev anymore)

  • file system creation
mkfs.ext4 /dev/device -m0 -Letichetta

(dopo il seguente comando, il filesystem perderà la compatibilità con ext3)

tune2fs -O extents,uninit_bg,dir_index /dev/device
Timing cached reads:   1858 MB in  2.00 seconds = 929.12 MB/sec
Timing buffered disk reads:  280 MB in  3.01 seconds =  93.15 MB/sec

XFS

Creazione

mkfs.xfs /dev/device -Letichetta

Frammentazione / Fragmentation

  • controllo stato:
xfs_db -c frag -r /dev/ <disk>
  • deframmentazione:
xfs_fsr
default parameters
xfs_fsr
 -m /etc/mtab              Get all defragmentable devices
 -t 1000                   Seconds to work
 -f /var/tmp/.fsrlast_xfs  Contains last file defragmented

Non è necessario deframmentare:

actual 992345, ideal 980834, fragmentation factor 1.16%

È necessario:

actual 511775, ideal 180931, fragmentation factor 64.65%
xfs_db -c frag -r  /dev/sdg1
actual 398296, ideal 335829, fragmentation factor 15.68%
xfs_fsr -t 1000
[...]
xfs_db -c frag -r  /dev/sdg1
actual 372842, ideal 335829, fragmentation factor 9.93%

ISO

mkisofs -f -J -r -l -v -volid "Volume Name" source_folder > iso_file_name.iso

Opzioni

-f, -follow-links --> Follow symbolic links
-V ID, -volid ID --> Set Volume ID
-volset ID --> Set Volume set ID
-volset-size # --> Set Volume set size
-volset-seqno # --> Set Volume set sequence number
  • File System: Joliet
 -J, -joliet --> Generate Joliet directory information
  • File System: ISO9660
 -l, -full-iso9660-filenames --> Allow full 31 character filenames for ISO9660 names
  • File System: ISO9660 relaxed (violates ISO9660)
 -max-iso9660-filenames --> Allow 37 character filenames for ISO9660 names (violates ISO9660)
 -allow-leading-dots --> Allow ISO9660 filenames to start with '.' (violates ISO9660)
 -ldots --> Allow ISO9660 filenames to start with '.' (violates ISO9660)
 -N, -omit-version-number --> Omit version number from ISO9660 filename (violates ISO9660)
 -relaxed-filenames --> Allow 7 bit ASCII except lower case characters (violates ISO9660)
 -no-iso-translate --> Do not translate illegal ISO characters '~', '-' and '#' (violates ISO9660)
 -allow-lowercase --> Allow lower case characters in addition to the current character set(violates ISO9660)
 -allow-multidot --> Allow more than one dot in filenames (e.g. .tar.gz) (violates ISO9660)
 -U, -untranslated-filenames --> Allow Untranslated filenames (for HPUX & AIX - violates ISO9660). Forces -l, -d, -N, -allow-leading-dots,
 -relaxed-filenames, -allow-lowercase, -allow-multidot 
  • File System: Rock Ridge
 -r, -rational-rock --> Generate rationalized Rock Ridge directory information
 -R, -rock --> Generate Rock Ridge directory information
  • File System: UDF
 -udf --> Generate UDF file system
 -dvd-video --> Generate DVD-Video compliant UDF file system


ReiserFS

3.6

# mkfs.reiserfs /dev/md8 -l usr --format 3.6
mkfs.reiserfs 3.6.19 (2003 www.namesys.com)

A pair of credits:
Nikita Danilov  wrote  most of the core  balancing code, plugin infrastructure,
and directory code. He steadily worked long hours, and is the reason so much of
the Reiser4 plugin infrastructure is well abstracted in its details.  The carry
f unction, and the use of non-recursive balancing, are his idea.

Edward Shushkin wrote the encryption and compression  file plugins,  and the V3
journal relocation code.

Format 3.6 with standard journal
Count of blocks on the device: 4196944
Number of blocks consumed by mkreiserfs formatting process: 8340
Blocksize: 4096
Hash function used to sort names: "r5"
Journal Size 8193 blocks (first block 18)
Journal Max transaction length 1024
inode generation number: 0
UUID: e620b92a-67b0-4d84-a193-2fea4ceb756a
LABEL: usr
ATTENTION: YOU SHOULD REBOOT AFTER FDISK!
        ALL DATA WILL BE LOST ON '/dev/md8'!
Continue (y/n):y
Initializing journal - 0%....20%....40%....60%....80%....100% 
Syncing..ok

Tell your friends to use a kernel based on 2.4.18 or later, and especially not a
kernel based on 2.4.9, when you use reiserFS. Have fun.

ReiserFS is successfully created on /dev/md8.


4

  • Creo il filesystem per la dir /usr/portage
# mkfs.reiser4 /dev/md8 -L usr -b 4096 -s 
mkfs.reiser4 1.0.6
Copyright (C) 2001-2005 by Hans Reiser, licensing governed by reiser4progs/COPYING.

Block size 4096 will be used.
Linux 2.6.29-gentoo-r5 is detected.
Uuid 4f849b56-1169-4396-81c8-8d0244254b3b will be used.
Reiser4 is going to be created on /dev/md8.
(Yes/No): Y

NTFS

Fat32