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