[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 /dev/hda1 /dev/hda2 /dev/hda3 /dev/hda4 /dev/hda5 /dev/hda6 |
[root@vm /]# fdisk Usage: fdisk [-l] [-b SSZ] [-u] device E.g.: fdisk /dev/hda |
mount无参数------显示当前mount上的设备
# df -h Filesystem /dev/hda2 /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) /dev/hda1 on /mnt/c type vfat (rw) |
IDE设备 | /dev/hda1 |
SCSI Device | /dev/sd2 |
光驱 | /dev/cdrom |
磁带 | /dev/rmt/0 |
软驱 | /dev/fd |
一来也是为了保护/分区
二来单独分区可以单独处理,比如在其他系统下mount,tar等
vi /etc/fstab /dev/hda4 |
文件系统 |
-t vfat orext2 |
-outf8 |
[root@localhost dev]# cat /proc/filesystems nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev nodev |
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 /dev/hda1 /dev/hda2 /dev/hda3 /dev/hda4 Partition 4 does not end on cylinder boundary. /dev/hda5 /dev/hda6 |
2. mount [root@localhost macg]# mount -t vfat /dev/hda6 /mnt/d D盘为什么是6,因为是扩展分区上的逻辑分区,逻辑分区都大于4 |
[root@localhost macg]# ls /mnt/d avi CloneCD.v5.2.1.1.rar DiabloII Drivers dvdoutput |
umount
#mount -t ext2 /dev/fd0/mnt/fd |
# mount -t ext2 /dev/cdrom /mnt/c mount: block device /dev/cdrom is write-protected, mountingread-only mount: wrong fs type, bad option, bad superblock on/dev/cdrom, # mount -t vfat /dev/cdrom /mnt/c mount: block device /dev/cdrom is write-protected, mountingread-only mount: wrong fs type, bad option, bad superblock on/dev/cdrom, |
# mount -t iso9660 /dev/cdrom /mnt/c mount: block device /dev/cdrom is write-protected, mountingread-only # ls /mnt/c stuck |
# ls -l crw------- crw------- lrwxrwxrwx lrwxrwxrwx crw-rw---- lrwxrwxrwx lrwxrwxrwx brw-r----- brw-rw---- |
看dmesg [root@localhost dev]# dmesg hdb: ATAPI 48X DVD-ROM DVD-RCD-R/RW drive, 2048kB Cache |
[root@localhost xinetd.d]# mount -t iso9660 /dev/cdrom/mnt/c mount: block device /dev/cdrom is write-protected, mountingread-only |
[root@localhost xinetd.d]# mount -t iso9660 /dev/dvdwriter/mnt/c mount: block device /dev/dvdwriter is write-protected, mountingread-only mount: /dev/dvdwriter alreadymounted or /mnt/c busy mount: according to mtab, /dev/hdb is already mounted on/mnt/c [root@localhost xinetd.d]# ls /mnt/c autorun eula.txt GPL |
[root@localhost ymp]# mount -o loop RHEL4-U4-i386-AS-disc1.iso/mnt/d/disk1 |
[root@localhost ymp]# ls /mnt/d/disk1 autorun EULA GPL |
[root@localhost mnt]# mount /mnt/d/ymp/RHEL4-U4-i386-AS-disc1.iso/mnt/cd
mount: /mnt/d/ymp/RHEL4-U4-i386-AS-disc1.iso is not a block device( maybe try `-oloop'?)
[root@localhost cd]# chmod +w isolinux/isolinux.bin
chmod: changing permissions of `isolinux/isolinux.bin': Read-onlyfile system
mount U盘
都是 /dev/sda/dev/sdb /dev/sdc
[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 /dev/hda1 /dev/hda2 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, 128974336bytes 16 heads, 32 sectors/track, 491 cylinders Units = cylinders of 512 * 512 = 262144 bytes /dev/sda1 Partition 1 has different physical/logical endings: |
把 fdisk -l 查到的U盘设备mount到目录中
[root@mail sbin]# mkdir /mnt/usb [root@mail sbin]# mount /dev/sda1/mnt/usb [root@mail sbin]# ls /mnt/usb 10.wma |
solaris 如何使用usb设备
cd /dev/dsk ls -l 查看usb设备 |
mount -F pcfs/dev/dsk/设备名字 跟linux不同,linux缺省类型是vfat,所以可以不设-tvfat 而solaris缺省类型是ufs,所以必须显示设置-Fpcfs |