This shows most of the information displayed by mount , but with a nice column layout showing the total size, amount of storage used, and the available space.

/proc/mounts contains the same information as /etc/mtab but is generated directly from the kernel's data structures (and is therefore more reliable).

The kernel uses memory as a buffer, writing data to disk periodically. Unmounting a disk flushes the buffer to disk immediately and updates the disk control structures to indicate that the drive is in a consistent (clean) state. If a drive is removed while mounted, some data (including parts of files) may not be written to the disk, resulting in data corruption.

2.8.3. What About...

2.8.3.1. ...partitioning a flash drive?

You can use the standard fdisk utility to partition a flash drive (after unmounting it, if necessary). Here is an example in which fdisk is used to divide a 64 MB flash drive into two partitions:

# fdisk /dev/sdb

Since fdisk is an interactive tool, it's necessary to enter single-letter commands to specify the changes that should be made to the partition table. First, print the partition table on the screen so you can review it:

Command (m for help): p

Disk /dev/sdb: 65 MB, 65536000 bytes

3 heads, 42 sectors/track, 1015 cylinders

Units = cylinders of 126 * 512 = 64512 bytes

 Device Boot Start End Blocks Id System

/dev/sdb1 1 1015 63924 83 Linux

This table shows a 64 MB device (64,512 bytes) with one partition.

If the display does not match the device you are trying to partition, you may be partitioning the wrong device; enter q to exit immediately! 

Delete the old partition:

Command (m for help): d

Selected partition 1

Create a new primary partition number 1 that is 30 MB in size:

Command (m for help): n

Command action

 e extended

 p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1015, default 1): ENTER

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-1015, default 1015): +30M  

Create a new primary partition number 2, taking up the rest of the drive:

Command (m for help): n

Command action

 e extended

 p primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (467-1015, default 467): ENTER

Using default value 467

Last cylinder or +size or +sizeM or +sizeK (467-1015, default 1015): ENTER

Using default value 1015

Print the partition table to check it:

Command (m for help): p

Disk /dev/sdb: 65 MB, 65536000 bytes

3 heads, 42 sectors/track, 1015 cylinders

Units = cylinders of 126 * 512 = 64512 bytes

 Device Boot Start End Blocks Id System

/dev/sdb1 1 466 29337 83 Linux

/dev/sdb2 467 1015 34587 83 Linux

Set the type code for the two partitions:

Command (m for help): t

Partition number (1-4): 1

Hex code (type L to list codes): L

 0 Empty 1e Hidden W95 FAT1 80 Old Minix be Solaris boot

 1 FAT12 24 NEC DOS 81 Minix / old Lin bf Solaris

 2 XENIX root 39 Plan 9 82 Linux swap / So c1 DRDOS/sec (FAT-

...(snip)...

 9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM df BootIt

 a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e1 DOS access

 b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e3 DOS R/O

 c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS e4 SpeedStor

 e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs

...(snip)...

1c Hidden W95 FAT3 75 PC/IX

Hex code (type L to list codes): c

Вы читаете Fedora Linux
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату