author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 22 Feb 2016 12:41:52 +0200 | |
changeset 1903 | 901e7394849f |
parent 1870 | 6d3eb4fdcb47 |
child 1905 | fba288d59662 |
permissions | -rw-r--r-- |
1334
9bf0d5a1f0cf
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1195
diff
changeset
|
1 |
.. -*- coding: utf-8; -*- |
9bf0d5a1f0cf
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1195
diff
changeset
|
2 |
.. include:: HEADER.rst |
1195 | 3 |
|
4 |
============== |
|
5 |
File system. |
|
6 |
============== |
|
1346
a2fbf50a43f4
Fix: Has no 'contents::' directive.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
7 |
.. contents:: |
1195 | 8 |
|
1870
6d3eb4fdcb47
List of supported by current Linux kernel FSes
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1493
diff
changeset
|
9 |
Supported FS. |
6d3eb4fdcb47
List of supported by current Linux kernel FSes
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1493
diff
changeset
|
10 |
============= |
6d3eb4fdcb47
List of supported by current Linux kernel FSes
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1493
diff
changeset
|
11 |
|
6d3eb4fdcb47
List of supported by current Linux kernel FSes
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1493
diff
changeset
|
12 |
List of supported by current Linux kernel FSes:: |
6d3eb4fdcb47
List of supported by current Linux kernel FSes
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1493
diff
changeset
|
13 |
|
6d3eb4fdcb47
List of supported by current Linux kernel FSes
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1493
diff
changeset
|
14 |
$ cat /proc/filesystems |
6d3eb4fdcb47
List of supported by current Linux kernel FSes
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1493
diff
changeset
|
15 |
|
1195 | 16 |
Make label on FAT32 volume. |
17 |
=========================== |
|
18 |
||
19 |
The volume name can be up to 11 characters long:: |
|
20 |
||
21 |
$ sudo mlabel -i /dev/<device> ::my-label |
|
22 |
||
23 |
or when create FAT32 file system:: |
|
24 |
||
25 |
$ sudo mkdosfs -n <vol-name> /dev/<device> |
|
26 |
||
27 |
Convert file name coding. |
|
28 |
========================= |
|
29 |
:: |
|
30 |
||
31 |
$ convmv --nosmart -f cp-1251 -t utf-8 -r $dir |
|
32 |
||
33 |
How get file time attributes. |
|
34 |
============================= |
|
35 |
||
36 |
POSIX define 3 file time attributes: atime (access time, only a few OS/fs update |
|
37 |
this parameter), ctime (attribute/inode modification time), mtime (modification |
|
38 |
time). |
|
39 |
||
40 |
To get time you can use 'ls' command but it print time in locale dependent |
|
41 |
irregular form:: |
|
42 |
||
43 |
$ ls -l file.txt # last file modification |
|
44 |
$ ls -lc file.txt # last file status modification |
|
45 |
$ ls -lu file.txt # last access |
|
46 |
||
47 |
GNU coreutils provide more robust 'stst' utility:: |
|
48 |
||
49 |
$ stat -c %Y file.txt # last file modification |
|
50 |
$ stat -c %Z file.txt # last file status modification |
|
51 |
$ stat -c %X file.txt # last access |
|
52 |
||
53 |
POSIX file name restriction. |
|
54 |
============================ |
|
55 |
||
56 |
Windows file name restriction. |
|
57 |
============================== |
|
58 |
||
59 |
http://msdn.microsoft.com/en-us/library/aa365247.aspx |
|
60 |
Naming Files, Paths, and Namespaces |
|
61 |
||
62 |
How get UUID and label? |
|
63 |
======================= |
|
64 |
||
65 |
Include UUID (Universally Unique Identifier) and labels:: |
|
66 |
||
67 |
$ ls -l /dev/disk/by-uuid/ |
|
68 |
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 46B6-1FD4 -> ../../sdb2 |
|
69 |
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 4C30299030298256 -> ../../sda1 |
|
70 |
||
71 |
$ ls -l /dev/disk/by-label/ |
|
72 |
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 bin -> ../../sda3 |
|
73 |
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 inst -> ../../sda2 |
|
74 |
lrwxrwxrwx 1 root root 10 2010-11-01 23:41 media -> ../../sdc5 |
|
75 |
||
76 |
$ sudo vol_id /dev/dm-2 |
|
77 |
ID_FS_USAGE=filesystem |
|
78 |
ID_FS_TYPE=ext3 |
|
79 |
ID_FS_VERSION=1.0 |
|
80 |
ID_FS_UUID=f7484fc9-75ec-4e46-8539-50b1e371b7ef |
|
81 |
ID_FS_UUID_ENC=f7484fc9-75ec-4e46-8539-50b1e371b7ef |
|
82 |
ID_FS_LABEL= |
|
83 |
ID_FS_LABEL_ENC= |
|
84 |
ID_FS_LABEL_SAFE= |
|
85 |
||
86 |
$ /sbin/blkid ## from 'e2fsprogs' package |
|
87 |
/dev/sdc2: UUID="46B6-1FD4" TYPE="vfat" |
|
88 |
/dev/sdb2: TYPE="ntfs" UUID="BC48D3FD48D3B47C" LABEL="inst" |
|
89 |
/dev/sda5: UUID="5240AED140AEBB5D" LABEL="music" TYPE="ntfs" |
|
90 |
/dev/sdc1: UUID="81c4444f-0b70-429a-9d97-8c13e8651f5b" TYPE="ext3" |
|
91 |
/dev/sdc3: UUID="KOpHWz-clDR-2MqV-vAkE-cPvY-uZrY-kjYJIb" TYPE="lvm2pv" |
|
92 |
||
93 |
$ udevinfo --query=all --name /dev/sdb ## from 'udev' package |
|
94 |
P: /block/sdb |
|
95 |
N: sdb |
|
96 |
S: disk/by-id/ata-WDC_WD1600JS-00MHB0_WD-WCANM5835587 |
|
97 |
S: disk/by-id/scsi-SATA_WDC_WD1600JS-00_WD-WCANM5835587 |
|
98 |
S: disk/by-path/pci-0000:00:08.0-scsi-1:0:0:0 |
|
99 |
E: ID_VENDOR=ATA |
|
100 |
E: ID_MODEL=WDC_WD1600JS-00M |
|
101 |
E: ID_REVISION=02.0 |
|
102 |
... |
|
103 |
||
104 |
How set UUID and label? |
|
105 |
======================= |
|
106 |
||
107 |
For ext2/ext3 fs:: |
|
108 |
||
109 |
$ sudo tune2fs /dev/hdb1 -U `uuid` |
|
110 |
||
111 |
Linux fs under Windows. |
|
112 |
======================= |
|
113 |
||
114 |
Ext2 IFS. |
|
115 |
--------- |
|
116 |
||
117 |
It provides Windows NT4.0/2000/XP/2003/Vista/2008 with full access to Linux Ext2 |
|
118 |
volumes (read access and write access). This may be useful if you have installed |
|
119 |
both Windows and Linux as a dual boot environment on your computer. |
|
120 |
||
121 |
The "Ext2 Installable File System for Windows" software is freeware. |
|
122 |
||
123 |
After install use 'ifsdrives.cpl' control panel to modify settings. |
|
124 |
||
125 |
http://www.fs-driver.org/ |
|
126 |
home page |
|
127 |
||
128 |
Ext2Fsd. |
|
129 |
-------- |
|
130 |
||
131 |
Ext2Fsd is an open source linux ext2/ext3 file system driver for Windows systems |
|
132 |
(NT/2K/XP/VISTA, X86/AMD64). |
|
133 |
||
134 |
http://www.ext2fsd.com/ |
|
135 |
Home page. |
|
136 |
http://sourceforge.net/projects/ext2fsd/ |
|
137 |
Sourceforge home page. |
|
138 |
||
139 |
||
140 |
rfstool. |
|
141 |
-------- |
|
142 |
||
143 |
Allows you to access ReiserFS partitions from a Windows 95/98/ME/NT/2000/XP |
|
144 |
system. It also allows you to access ReiserFS partitions from Linux. It is a |
|
145 |
complete rewrite of the ReiserFS functions needed to list directories, copy |
|
146 |
files, and backup metadata. |
|
147 |
||
148 |
http://p-nand-q.com/e/reiserfs.html |
|
149 |
home page |
|
150 |
http://freshmeat.net/projects/rfstool/ |
|
151 |
Freshmeat home page. |
|
152 |
||
153 |
Summary files size. |
|
154 |
=================== |
|
155 |
:: |
|
156 |
||
157 |
$ find . -type f -iname "*.log" -print0 | du --files0-from=- -c -m | tail -n 1 \ |
|
158 |
| (read first rest; echo $first) |
|
159 |
||
160 |
Mount NTFS in Linux. |
|
161 |
==================== |
|
162 |
||
163 |
Mount in rw mode:: |
|
164 |
||
165 |
$ man 8 ntfs-3g |
|
166 |
$ cat /etc/fstab |
|
167 |
... |
|
168 |
UUID=D474CB9874CB7C2C /mnt/winbin ntfs-3g rw,default_permissions,gid=1000,fmask=113,dmask=002,noatime,silent 0 0 |
|
169 |
... |
|
170 |
||
1493
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
171 |
Stop fsck running every 27 boots. |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
172 |
================================= |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
173 |
|
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
174 |
Check current settings:: |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
175 |
|
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
176 |
$ tune2fs -l /dev/$DISK |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
177 |
|
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
178 |
and tune them:: |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
179 |
|
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
180 |
$ tune2fs -c 0 /dev/$DISK |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
181 |
$ tune2fs -i 2w /dev/$DISK |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
182 |
|
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
183 |
Or disable checks in ``/etc/fstab`` completely (by setting last colon to ``0`` |
667fab70b4b1
Stop fsck running every 27 boots.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1346
diff
changeset
|
184 |
value)! |