标签:style class code tar ext color
fdisk –l查看dos/win/ext2分区(partiton,不是slice,slice是solaris分区)
[root@localhost etc]# /sbin/fdisk -l Disk /dev/hda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 1 991 7960176 b W95 FAT32 /dev/hda2 992 1629 5124735 83 Linux /dev/hda3 1630 8070 51737332+ f W95 Ext‘d (LBA) /dev/hda4 * 8071 9730 13327776 bf Solaris 这个是主分区,MBR(启动记录扇区)的所在 /dev/hda5 1630 1695 530113+ 82 Linux swap / Solaris /dev/hda6 1696 8070 51207156 b W95 FAT32 |
linux
下把DOS扩展分区和逻辑分区都按hda1,2,3,4,5,6排列。扩展分区必须在1-4内,逻辑分区必须>4
[root@vm /]# fdisk Usage: fdisk [-l] [-b SSZ] [-u] device E.g.: fdisk /dev/hda (for the first IDE disk) or: fdisk /dev/sdc (for the third SCSI disk) or: fdisk /dev/eda (for the first PS/2 ESDI drive) or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices) ... |
# df -h Filesystem Size Used Avail Use% Mounted on /dev/hda2 4.8G 2.9G 1.7G 65% / /dev/shm 93M 0 93M 0% /dev/shm |
而mount显示的虚mount太多 [root@localhost etc]# mount /dev/hda2 on / type ext2 (rw) /dev/proc on /proc type proc (rw) automount(pid1622) on /misc type autofs (rw,fd=4,pgrp=1622,minproto=2,maxproto=4) automount(pid1672) on /net type autofs (rw,fd=4,pgrp=1672,minproto=2,maxproto=4) 这几个都是虚mount /dev/hda1 on /mnt/c type vfat (rw) |
IDE设备 | /dev/hda1 尾字母hda,hdb表示不同的硬盘 尾数字hda1,hda2,hda3表示不同的分区 |
SCSI Device | /dev/sd2 |
光驱 | /dev/cdrom |
磁带 | /dev/rmt/0
(常用于tar) |
软驱 | /dev/fd 或 /dev/fd0 |
vi /etc/fstab /dev/hda4 /mnt/wind vfat defaults,iocharset=utf8,umask=000 0 0 |
文件系统 mount
point
分区格式
mount参数 umask=000指定加载后的目录的权限问题, 都是0,向所有用户开放读写权限 |
-t vfat or
ext2 -t
:Type ext2 linux分区 vfat dos/win分区 不设-t,缺省mount认为是vfat |
-o
utf8
utf8是编码格式,否则中文会有问题 |
[root@localhost dev]# cat /proc/filesystems nodev sysfs nodev rootfs nodev bdev nodev proc nodev sockfs nodev binfmt_misc nodev debugfs nodev usbfs nodev pipefs nodev futexfs nodev tmpfs nodev eventpollfs nodev devpts ext2 Linux用的文件系统 nodev ramfs nodev hugetlbfs iso9660 光盘片用的文件系统 nodev mqueue nodev selinuxfs nodev rpc_pipefs nodev autofs autofs 光盘、软盘的自动加载 vfat Win95/98/2000文件系统 |
1. Fdisk -l [root@localhost macg]# /sbin/fdisk -l Disk /dev/hda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 1 991 7960176 b W95 FAT32 /dev/hda2 992 1629 5124735 83 Linux /dev/hda3 1630 8070 51737332+ f W95 Ext‘d (LBA) /dev/hda4 * 8071 9730 13327776 bf Solaris Partition 4 does not end on cylinder boundary. /dev/hda5 1630 1695 530113+ 82 Linux swap / Solaris /dev/hda6 1696 8070 51207156 b W95 FAT32 |
2. mount [root@localhost macg]# mount -t vfat /dev/hda6 /mnt/d D盘为什么是6,因为是扩展分区上的逻辑分区 ,逻辑分区都大于4 |
[root@localhost macg]# ls /mnt/d avi game military temp CloneCD.v5.2.1.1.rar ghostmp3cdmaker.rar Nero_6.6.1.4.zip The.Hot.the.Cool.&_.the.Vicious.1976.dvdrip.cd2.avi Diablo II image.ccd nero.rar treat1 Drivers image.img Recycled UltraISO_8.2.0.1665.zip dvdoutput image.sub short yao |
#mount -t ext2 /dev/fd0
/mnt/fd |
# mount -t ext2 /dev/cdrom /mnt/c mount: block device /dev/cdrom is write-protected, mounting read-only mount: wrong fs type, bad option, bad superblock on /dev/cdrom, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so # mount -t vfat /dev/cdrom /mnt/c mount: block device /dev/cdrom is write-protected, mounting read-only mount: wrong fs type, bad option, bad superblock on /dev/cdrom, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so |
# mount -t iso9660 /dev/cdrom /mnt/c mount: block device /dev/cdrom is write-protected, mounting read-only # ls /mnt/c stuck |
# ls -l crw------- 1 root root 10, 134 Feb 7 2007 apm_bios crw------- 1 root root 14, 4 Feb 7 2007 audio lrwxrwxrwx 1 root root 3 Feb 7 2007 cdrom -> hdb lrwxrwxrwx 1 root root 3 Feb 7 2007 cdwriter -> hdb crw-rw---- 1 root root 5, 1 Feb 7 2007 console lrwxrwxrwx 1 root root 3 Feb 7 2007 dvd -> hdb lrwxrwxrwx 1 root root 3 Feb 7 2007 dvdwriter -> hdb brw-r----- 1 root disk 3, 9 Feb 7 2007 hda9 brw-rw---- 1 root disk 3, 64 Feb 7 2007 hdb |
看dmesg [root@localhost dev]# dmesg hdb: ATAPI 48X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache |
[root@localhost xinetd.d]# mount -t iso9660 /dev/cdrom
/mnt/c mount: block device /dev/cdrom is write-protected, mounting read-only |
[root@localhost xinetd.d]# mount -t iso9660 /dev/dvdwriter
/mnt/c mount: block device /dev/dvdwriter is write-protected, mounting read-only mount: /dev/dvdwriter already mounted or /mnt/c busy mount: according to mtab, /dev/hdb is already mounted on /mnt/c [root@localhost xinetd.d]# ls /mnt/c autorun images RELEASE-NOTES RPM-GPG-KEY-fedora-rawhide eula.txt isolinux RPM-GPG-KEY RPM-GPG-KEY-fedora-test GPL README-Accessibility RPM-GPG-KEY-fedora TRANS.TBL |
[root@localhost ymp]# mount -o loop RHEL4-U4-i386-AS-disc1.iso /mnt/d/disk1 |
[root@localhost ymp]# ls /mnt/d/disk1 autorun RELEASE-NOTES-bn.html RELEASE-NOTES-U1-it.html RELEASE-NOTES-U2-ta.html RELEASE-NOTES-U4-en.html EULA RELEASE-NOTES-de.html RELEASE-NOTES-U1-ja.html RELEASE-NOTES-U2-zh_CN.html RELEASE-NOTES-U4-es.html GPL |
[root@mail home]# /sbin/fdisk -l Disk /dev/hda: 10.0 GB, 10005037568 bytes 255 heads, 63 sectors/track, 1216 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 1216 9663097+ 8e Linux LVM Disk /dev/dm-0: 9294 MB, 9294577664 bytes 255 heads, 63 sectors/track, 1130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-0 doesn‘t contain a valid partition table Disk /dev/dm-1: 536 MB, 536870912 bytes 255 heads, 63 sectors/track, 65 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-1 doesn‘t contain a valid partition table Disk /dev/sda: 128 MB, 128974336 bytes 16 heads, 32 sectors/track, 491 cylinders Units = cylinders of 512 * 512 = 262144 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 492 125928+ 6 FAT16 Partition 1 has different physical/logical endings: phys=(499, 15, 32) logical=(491, 15, 32) |
[root@mail sbin]# mkdir /mnt/usb [root@mail sbin]# mount /dev/sda1 /mnt/usb [root@mail sbin]# ls /mnt/usb 10.wma 16.wma 5293.mp3 7406.mp3 am2-bach.wma beethoven4.wma do12.wma kisin3.mp3 11.wma 17.wma 5706.mp3 7.wma am4-bach.wma beethoven5.wma do15.wma mozart570.wma kisin25.mp3 |
cd /dev/dsk ls -l 查看usb设备 |
mount -F pcfs
/dev/dsk/设备名字 /mountpoint 跟linux不同,linux缺省类型是vfat,所以可以不设-t vfat 而solaris缺省类型是ufs,所以必须显示设置-F pcfs |
linux文件系统和mount(硬盘,win分区,光驱,U盘),布布扣,bubuko.com
linux文件系统和mount(硬盘,win分区,光驱,U盘)
标签:style class code tar ext color
原文地址:http://www.cnblogs.com/bluewelkin/p/3809121.html