- 浏览: 203374 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (138)
- Linux - Adiministration (4)
- Linux - Shell (3)
- Linux - Programming (10)
- Linux - Miscellaneous (57)
- Theory - Data Structure & Algorithm (2)
- Theory - Fundamentals of Compiling (0)
- Theory - Operating System (0)
- Theory - Database (0)
- Theory - Miscellaneous (0)
- Oracle (16)
- J2SE&J2EE (32)
- 杂项 (8)
- UCM (1)
- English (1)
- 我的超级菜谱 (1)
- Case - J2EE Tutorial (0)
- Case - J2EE架构师之优秀枪手 (10)
- Apache项目学习 (0)
最新评论
-
yaolixing01:
他山界面开发框架 v22是一套基于Gecko v22 的开源收 ...
Firefox Plugin - Gecko SDK/npapi -
chenpeilei2003:
您是这篇博文的原创吗 , 我通篇看完了, 很受教。
学习的目 ...
如何系统地学习linux? -
inprice:
羊蝎子 -
inprice:
...
羊蝎子 -
RobertLeeJesus:
因为我有两台T61
我安装Solaris的全过程。
multiple disks, multiple partitions, multiple OS
- 博客分类:
- Linux - Miscellaneous
1. 基本知识
一块硬盘可以有1-3个主分区和1个扩展分区,或者1-4个主分区。一个扩展分区可以分为若干个逻辑分区。
硬盘的容量=主分区的容量+扩展分区的容量
扩展分区的容量=各个逻辑分区的容量之和
通常,在PC机上使用的硬盘有两种:
1) IDE接口:最常见的;
2) SCSI接口:比IDE性能好,但更贵!
操作系统对分区的要求。
Windows必须安装在主分区上。磁盘格式为FAT32/NTFS
Solaris(Unix)必须安装在主分区上。磁盘格式为Solaris
Ubuntu(Linux)可以安装在逻辑分区上。磁盘格式为Ext3/swap
2. Windows
Partition Diagrams
3. Linux(Ubuntu)
Linux下的磁盘设备
IDE设备:一台PC上可以有两个IDE接口(我将其称为第一IDE、第二IDE),而每个IDE接口上可以接两个IDE设备(我将其称为主盘、从盘)。其中硬盘与光驱都是IDE设备。Linux这样为其命名:
第一IDE的主盘:/dev/hda
第一IDE的从盘:/dev/hdb
第二IDE的主盘:/dev/hdc
第二IDE的从盘:/dev/hdd
SCSI设备:这个相对大家会陌生一些,它通常需要加上一块SCSI卡来驱动。
第一块SCSI设备称为:/dev/sda
第二块SCSI设备称为:/dev/sdb……
以此类推。
Linux下的分区命名
也就是主分区(或扩展分区)被命名为hda1-hda4,如果没有,就跳过。而扩展分区中的逻辑分区则从hda5开始编号,以此类推。 这里是以第一IDE的主盘为例,如果是第二硬盘,就是hdb1、hdb2、hdb5、hdb6、hdb7。
Command - View Disks
robert@laptop-ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x18bc18bc
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5838 46886912 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 5838 6360 4195328 c W95 FAT32 (LBA)
Partition 2 does not end on cylinder boundary.
/dev/sda3 6360 8971 20971096 bf Solaris
/dev/sda4 8972 14593 45158715 f W95 Ext'd (LBA)
/dev/sda5 11582 14593 24191968+ 7 HPFS/NTFS
/dev/sda6 8972 11087 16996707 83 Linux
/dev/sda7 11088 11581 3968023+ 82 Linux swap / Solaris
Partition table entries are not in disk order
Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe6e9f997
Device Boot Start End Blocks Id System
/dev/sdb1 1 4177 33551721 c W95 FAT32 (LBA)
/dev/sdb2 4178 8354 33551752+ 7 HPFS/NTFS
/dev/sdb3 8355 9729 11044687+ c W95 FAT32 (LBA)
Command - View one Disk
robert@laptop-ubuntu:~$ sudo fdisk -l /dev/sda
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x18bc18bc
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5838 46886912 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 5838 6360 4195328 c W95 FAT32 (LBA)
Partition 2 does not end on cylinder boundary.
/dev/sda3 6360 8971 20971096 bf Solaris
/dev/sda4 8972 14593 45158715 f W95 Ext'd (LBA)
/dev/sda5 11582 14593 24191968+ 7 HPFS/NTFS
/dev/sda6 8972 11087 16996707 83 Linux
/dev/sda7 11088 11581 3968023+ 82 Linux swap / Solaris
Partition table entries are not in disk order
Command - Disk Usage
robert@laptop-ubuntu:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 16729812 13400616 2479364 85% /
tmpfs 1023600 0 1023600 0% /lib/init/rw
varrun 1023600 120 1023480 1% /var/run
varlock 1023600 0 1023600 0% /var/lock
udev 1023600 2872 1020728 1% /dev
tmpfs 1023600 104 1023496 1% /dev/shm
lrm 1023600 2004 1021596 1% /lib/modules/2.6.27-11-generic/volatile
/dev/sdb1 33535328 99216 33436112 1% /media/Work
/dev/sdb3 11033888 7937768 3096120 72% /media/Buffer
/dev/sdb2 33551752 23135812 10415940 69% /media/Backup
Mount Disks
mount ntfs, the permission is 777, however, mount fat it is 755, in addition, you can't change the permission and owner.
mount -t ntfs /dev/sda5 /media/Work
mount -t vfat /dev/sdb1 /media/Work
If you want any user to access the partition, please use the /etc/fstab to mount the disks as follows,
Add the lines to /etc/fstab,
/dev/sdb1 /media/Work vfat iocharset=utf8,umask=000 0 0
/dev/sdb2 /media/Backup ntfs iocharset=utf8,umask=000 0 0
/dev/sdb3 /media/Buffer vfat iocharset=utf8,umask=000 0 0
Disk Summary
sda1(Windows:C) sda2(OBI:Windows Recovery) sda3(Solaris) sda4(Extended Partition)
-----sda6(Ubuntu Ext3) sda7(Ubuntu Swap) sda5(Windows:D)
sdb1(WORK) sdb2(BACKUP) sdb3(BUFFER)
Partition Diagram
4. Solaris
Solaris(FAT32)(Only Fat32 can be mapped by default)
1). Find which file is the hard disk?
robert@laptop-opensolaris:/dev/dsk# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c5t0d0
<DEFAULT cyl 2608 alt 2 hd 255 sec 63>
/pci@0,0/pci17aa,20a7@1f,2/disk@0,0
Specify disk (enter its number): ^C
So the c5t0d0 is the disk.
2). Find all of the disk files about c5t0d0.
robert@laptop-opensolaris:/dev/dsk# ls -l | grep c5t0d0
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0p0 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:q
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0p1
-> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:r
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0p2 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:s
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0p3 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:t
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0p4 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:u
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s0 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:a
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s1 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:b
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s10 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:k
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s11 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:l
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s12 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:m
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s13 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:n
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s14 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:o
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s15 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:p
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s2 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:c
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s3 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:d
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s4 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:e
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s5 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:f
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s6 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:g
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s7 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:h
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s8 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:i
lrwxrwxrwx 1 root root 50 2008-10-29 14:30 c5t0d0s9 -> ../../devices/pci@0,0/pci17aa,20a7@1f,2/disk@0,0:j
c5t0d0p0,c5t0d0p1,c5t0d0p2,c5t0d0p3,c5t0d0p4 are the partitions.
c5t0d0p0: While Disk
c5t0d0p1: Windows C
c5t0d0p2: OBI Recovery Partition
c5t0d0p3: Solaris OS
c5t0d0p4: Whole Extended Partition
3). Mount the Windows Partition.
mount -F pcfs /dev/dsk/c5t0d0p2 /OBI
Solaris(NTFS)(Need install softares)
wget http://www.belenix.org/binfiles/FSWpart.tar.gz
gunzip -c FSWpart.tar.gz | tar xf -
pkgadd -d . FSWpart [点后面有个空格]
wget http://www.belenix.org/binfiles/FSWfsmisc.tar.gz
gunzip -c FSWfsmisc.tar.gz | tar xf -
pkgadd -d . FSWfsmisc[点后面有个空格]
-bash-3.2# prtpart
Fdisk information for device /dev/rdsk/c4d0p0
Block Size : 512 bytes
Controller : ide
Disk : cmdk
Capacity : 55 GB
# start block # nblocks startCylSecHd endCylSecHd OSType
1: 0000000063 0030723777 0/ 1/ 1 ff/ff/ef IFS: NTFS
2: 0030723840 0070096320 ff/c1/ 0 ff/ff/ef WIN95 Extended(LBA)
# start block # nblocks startCylSecHd endCylSecHd OSType
5: 0000000063 0040960017 ff/ff/ef ff/ff/ef IFS: NTFS
0: 0040960080 0029136240 ff/ff/ef ff/ff/ef DOS Extended
# start block # nblocks startCylSecHd endCylSecHd OSType
6: 0000000063 0029136177 ff/ff/ef ff/ff/ef IFS: NTFS
3: 0100820223 0016390017 ff/ff/fe ff/ff/fe Solaris x86
-bash-3.2# su - nova
Sun Microsystems Inc. SunOS 5.11 snv_86 January 2008
-bash-3.2$ ls
core Desktop
-bash-3.2$ cd D*
-bash-3.2$ ls
FSWfsmisc FSWpart 新文件
FSWfsmisc.tar.gz FSWpart.tar 新文件~
-bash-3.2$ su - root
-bash-3.2# prtpart /dev/rdsk/c4d0p0 -ldevs
Fdisk information for device /dev/rdsk/c4d0p0
** NOTE **
/dev/dsk/c4d0p0 - Physical device referring to entire physical disk
/dev/dsk/c4d0p1 - p4 - Physical devices referring to the 4 primary partitions
/dev/dsk/c4d0p5 ... - Virtual devices referring to logical partitions
Virtual device names can be used to access EXT2 and NTFS on logical partitions
/dev/dsk/c4d0p1 IFS: NTFS
/dev/dsk/c4d0p2 WIN95 Extended(LBA)
/dev/dsk/c4d0p5 IFS: NTFS
/dev/dsk/c4d0p6 IFS: NTFS
/dev/dsk/c4d0p3 Solaris x86
-bash-3.2# mkdir /winnt_D
-bash-3.2# mount -F ntfs /dev/dsk/c4d0p5 /winnt_D
-bash-3.2# mkdir /winnt_E
-bash-3.2# mount -F ntfs /dev/dsk/c4d0p6 /winnt_E
-bash-3.2# df -h
rpool/ROOT/opensolaris/opt
7.1G 981M 3.3G 23% /opt
rpool/export 7.1G 19K 3.3G 1% /export
rpool/export/home 7.1G 271M 3.3G 8% /export/home
rpool 7.1G 57K 3.3G 1% /rpool
rpool/ROOT 7.1G 18K 3.3G 1% /rpool/ROOT
127.0.0.1:/ 156G 156G 0K 100% /winnt_D
127.0.0.1:/ 111G 111G 0K 100% /winnt_E
-bash-3.2# xlsmounts
PHYSICAL DEVICE LOGICAL DEVICE FS PID ADDR Mounted on
/dev/dsk/c4d0p0 /dev/dsk/c4d0p5 ntfs 1633 127.0.0.1:/ /winnt_D
/dev/dsk/c4d0p0 /dev/dsk/c4d0p6 ntfs 1645 127.0.0.1:/ /winnt_E
发表评论
-
Replace text in file
2009-06-09 21:53 865Windows @echo off if ... -
cpio
2009-06-08 15:31 1058Extract cpio -i </ ... -
Start to use svn
2009-04-14 15:18 816http://artis.imag.fr/~Xavier.De ... -
Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
2009-03-11 00:46 1448原文 http://www.linuxsir.or ... -
Solaris Compiz Desktop Effect doesn't work.
2009-03-01 23:34 826When I enable the Solaris Deskt ... -
How to make a process run after the user logs out?
2009-01-04 18:05 871nohup nohup sort sales.dat ... -
进行有效编辑的七种习惯(vim)
2008-12-16 11:52 1063如果你的很多时间是用 ... -
Miscelaneous Tricks to use the Linux Command Line
2008-12-10 14:29 8471. The process name for Linux e ... -
How to map remote network drive
2008-12-09 15:29 8441. sudo apt-get install smbfs ... -
Install the SSH server - openssh-server
2008-12-09 15:24 1056sudo apt-get install openssh-se ... -
Ubuntu系统目录结构
2008-12-09 08:52 1089Ubuntu系统目录结构 ================== ... -
Ubuntu APT Proxy
2008-11-22 14:43 1094When I use ubuntu desktop in VM ... -
Ubuntu 8.10 + T61 nvidia 显卡驱动(特效)(compiz)不好用
2008-11-16 20:30 20971. System -> Administration ... -
Ubuntu 8.10 + T61中间小红钮不好用
2008-10-31 20:11 10681. Edit /etc/X11/xorg.conf, a ... -
Common compress command.
2008-10-31 11:51 957zip -r dest.zip source unzip -d ... -
How to see how much is a folder or a file?
2008-10-31 11:41 747du -sh -
How to decide what Linux is installed?
2008-10-31 11:34 726vi /proc/version -
Adding a startup script to be run at bootup
2008-10-30 21:30 1301Ubuntu 1. sudo vi /etc/init ... -
如何删除老版本的Ubuntu内核
2008-10-28 16:49 906sudo aptitude purge ~ilinux-im ... -
Difference between ksh a.sh and exec a.sh
2008-10-13 09:54 9521. ksh 就是让现有的shell pending, 然后新 ...
相关推荐
on MBR formatted hard disks, thus allowing multiple booting with other Windows OS. Like in the previous 10.6 version, you have to replace 2 files in the original dvd content: -OSInstall goes into /...
g4u ("ghost for unix") is a NetBSD-based bootfloppy/CD-ROM that allows easy cloning of PC harddisks to deploy a common setup on a ... Easy cloning of local disks as well as partitions is also supported.
/disks ``` 这会列出所有连接的磁盘及其相关信息,包括 ID。 **步骤三:备份数据** 在进行任何修改前,务必备份重要数据,以防操作失误导致数据丢失。 **步骤四:修改磁盘 ID** 在 RouterOS 中,修改磁盘 ID 主要...
on MBR formatted hard disks, thus allowing multiple booting with other Windows OS. Like in the previous 10.6 version, you have to replace 2 files in the original dvd content: -OSInstall goes into /...
1987年,加州大学伯克利分校的Patterson,Gibson和Katz发表了一篇题为“A Case for Redundant Array of Inexpensive Disks(RAID)”的论文,讲述了RAID
R-Studio is a family of ... It functions on local and network disks, even if such partitions are formatted, damaged or deleted. Flexible parameter settings give you absolute control over data recovery.
《当好磁盘变坏:HP-UX LVM下的磁盘故障处理》 在IT行业中,数据存储设备的稳定性与可靠性至关重要。磁盘作为数据存储的主要载体,其故障的发生不仅可能导致数据丢失,还可能引发系统崩溃,从而对业务连续性和企业...
现代操作系统课件:Chapter5-Disks.ppt
最后,文档讨论了I/O模型和RAID(Redundant Array of Independent Disks)。I/O操作通常通过中断、DMA等方式进行,而RAID技术则是为了提高磁盘存储的性能和数据安全性。RAID级别包括RAID 0、1、5、6等,每种都有其...
该存储库不再维护,使用时需要您... 用法 var njds = require('nodejs-disks'); njds.drives( function (err, drives) { njds.drivesDetail( drives, function (err, data) { for(var i = 0; i<data.length; i++) {
在IT领域,RAID(Redundant Array of Independent Disks,独立磁盘冗余阵列)是一种通过组合多个物理磁盘驱动器来提高数据可靠性和性能的技术。本文将深入探讨如何调整已存在的软件RAID分区的大小,包括如何缩小...
RVTools is a Windows .NET (4.6.2 or higher) application which uses ... RVTools is able to list information about VMs, CPU, Memory, Disks, Partitions, Network, CD drives, USB devices. Snapshots, VMware
VirtualCenter 5.x, ESX Server 5.x, VirtualCenter 6.x, ESX Server 6.x, VirtualCenter 7.0 and ESX server 7.0 RVTools is able to list information about VMs, CPU, Memory, Disks, Partitions, Network, CD ...
《Netware Client 3.12安装盘详解》 Novell Netware Client 3.12是一款历史悠久且在1990年代中期广泛使用的网络操作系统客户端软件,它为用户提供了接入Novell Netware服务器的能力,使得用户能够在个人计算机上...
CentOS(Community ENTerprise Operating System)是一个基于Red Hat Enterprise Linux构建的免费企业级操作系统,它的主要目的是为用户提供一个稳定可靠的操作环境。CentOS 7是CentOS系列的一个重要版本,其发布于...
Glary Undelete supports multiple file system ie NTFS + EFS, FAT , NTFS . Moreover, it is able to recover files that the user has compressed or fragmented or even encrypted on NTFS file system. Works ...
DRBD is a software-based, shared-nothing, replicated storage solution mirroring the content of block devices (hard disks, partitions, logical volumes etc.) between hosts.
12zp很多人问什么比较好,这个开发的工具fzfnt+vb4disks这是一个组合