fs.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 28 Nov 2011 01:09:29 +0200
changeset 1110 6e71ffc71972
parent 697 454bc71092a7
permissions -rw-r--r--
small fix
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
197
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
-*- mode:outline; coding: utf-8 -*-
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
* Make label on FAT32 volume.
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
The volume name can be up to 11 characters long.
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
  $ sudo mlabel -i /dev/<device> ::my-label
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
or when create FAT32 file system:
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
  $ sudo mkdosfs -n <vol-name> /dev/<device>
89a7852aa71b Make label on FAT32 volume.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
381
bce5618a8704 Convert file name coding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 197
diff changeset
    13
* Convert file name coding.
bce5618a8704 Convert file name coding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 197
diff changeset
    14
bce5618a8704 Convert file name coding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 197
diff changeset
    15
  $ convmv --nosmart -f cp-1251 -t utf-8 -r $dir
446
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    16
519
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    17
* How get file time attributes.
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    18
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    19
POSIX define 3 file time attributes: atime (access time, only a few OS/fs update
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    20
this parameter), ctime (attribute/inode modification time), mtime (modification
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    21
time).
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    22
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    23
To get time you can use 'ls' command but it print time in locale dependent
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    24
irregular form:
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    25
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    26
  $ ls -l file.txt      # last file modification
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    27
  $ ls -lc file.txt     # last file status modification
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    28
  $ ls -lu file.txt     # last access
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    29
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    30
GNU coreutils provide more robust 'stst' utility:
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    31
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    32
  $ stat -c %Y file.txt # last file modification
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    33
  $ stat -c %Z file.txt # last file status modification
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    34
  $ stat -c %X file.txt # last access
bf4dcc22ccd9 How get file time attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 447
diff changeset
    35
446
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    36
* File names.
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    37
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    38
** POSIX.
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    39
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    40
** Windows.
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    41
447
4c923e95c2e5 update link
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 446
diff changeset
    42
  http://msdn.microsoft.com/en-us/library/aa365247.aspx
446
047e6ecce4ee File names.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 381
diff changeset
    43
                Naming Files, Paths, and Namespaces
598
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
    44
646
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    45
* Block device attributes.
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    46
648
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    47
** How get UUID and label?
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    48
647
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    49
Include UUID (Universally Unique Identifier) and labels.
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    50
646
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    51
  $ ls -l /dev/disk/by-uuid/
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    52
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 46B6-1FD4 -> ../../sdb2
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    53
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 4C30299030298256 -> ../../sda1
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    54
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    55
  $ ls -l /dev/disk/by-label/
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    56
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 bin -> ../../sda3
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    57
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 inst -> ../../sda2
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    58
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 media -> ../../sdc5
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    59
647
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    60
  $ sudo vol_id /dev/dm-2
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    61
ID_FS_USAGE=filesystem
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    62
ID_FS_TYPE=ext3
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    63
ID_FS_VERSION=1.0
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    64
ID_FS_UUID=f7484fc9-75ec-4e46-8539-50b1e371b7ef
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    65
ID_FS_UUID_ENC=f7484fc9-75ec-4e46-8539-50b1e371b7ef
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    66
ID_FS_LABEL=
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    67
ID_FS_LABEL_ENC=
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    68
ID_FS_LABEL_SAFE=
100203a7752b 'vol_id' utility.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 646
diff changeset
    69
646
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    70
  $ /sbin/blkid     ## from 'e2fsprogs' package
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    71
/dev/sdc2: UUID="46B6-1FD4" TYPE="vfat"
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    72
/dev/sdb2: TYPE="ntfs" UUID="BC48D3FD48D3B47C" LABEL="inst"
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    73
/dev/sda5: UUID="5240AED140AEBB5D" LABEL="music" TYPE="ntfs"
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    74
/dev/sdc1: UUID="81c4444f-0b70-429a-9d97-8c13e8651f5b" TYPE="ext3"
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    75
/dev/sdc3: UUID="KOpHWz-clDR-2MqV-vAkE-cPvY-uZrY-kjYJIb" TYPE="lvm2pv"
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    76
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    77
  $ udevinfo --query=all --name /dev/sdb    ## from 'udev' package
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    78
P: /block/sdb
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    79
N: sdb
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    80
S: disk/by-id/ata-WDC_WD1600JS-00MHB0_WD-WCANM5835587
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    81
S: disk/by-id/scsi-SATA_WDC_WD1600JS-00_WD-WCANM5835587
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    82
S: disk/by-path/pci-0000:00:08.0-scsi-1:0:0:0
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    83
E: ID_VENDOR=ATA
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    84
E: ID_MODEL=WDC_WD1600JS-00M
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    85
E: ID_REVISION=02.0
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    86
...
902e1273a3ac Block device attributes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 599
diff changeset
    87
648
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    88
** How set UUID and label?
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    89
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    90
For ext2/ext3 fs:
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    91
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    92
  $ sudo tune2fs /dev/hdb1 -U `uuid`
d46bffeb8fa9 How set UUID and label?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 647
diff changeset
    93
598
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
    94
* Linux fs under Windows.
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
    95
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
    96
** Ext2 IFS.
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
    97
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
    98
It provides Windows NT4.0/2000/XP/2003/Vista/2008 with full access to Linux Ext2 volumes (read
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
    99
access and write access). This may be useful if you have installed both Windows and Linux as a dual
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   100
boot environment on your computer.
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   101
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   102
The "Ext2 Installable File System for Windows" software is freeware.
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   103
599
035920d3833c Added correction.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 598
diff changeset
   104
After install use 'ifsdrives.cpl' control panel to modify settings.
035920d3833c Added correction.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 598
diff changeset
   105
598
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   106
  http://www.fs-driver.org/
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   107
                home page
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   108
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   109
** Ext2Fsd.
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   110
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   111
Ext2Fsd is an open source linux ext2/ext3 file system driver for Windows systems (NT/2K/XP/VISTA,
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   112
X86/AMD64).
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   113
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   114
  http://www.ext2fsd.com/
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   115
                home page
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   116
  http://sourceforge.net/projects/ext2fsd/
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   117
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   118
** rfstool.
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   119
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   120
Allows you to access ReiserFS partitions from a Windows 95/98/ME/NT/2000/XP system. It also allows
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   121
you to access ReiserFS partitions from Linux. It is a complete rewrite of the ReiserFS functions
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   122
needed to list directories, copy files, and backup metadata.
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   123
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   124
  http://p-nand-q.com/e/reiserfs.html
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   125
                home page
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   126
  http://freshmeat.net/projects/rfstool/
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   127
36edace509c9 Linux fs under Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 519
diff changeset
   128
697
454bc71092a7 Summary files size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 648
diff changeset
   129
* Summary files size.
454bc71092a7 Summary files size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 648
diff changeset
   130
454bc71092a7 Summary files size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 648
diff changeset
   131
  $ find . -type f -iname "*.log" -print0 | du --files0-from=- -c -m | tail -n 1 \
454bc71092a7 Summary files size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 648
diff changeset
   132
      | (read first rest; echo $first)
454bc71092a7 Summary files size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 648
diff changeset
   133