1. 程式人生 > >Linux添加新硬盤,fdisk新建分區

Linux添加新硬盤,fdisk新建分區

linux添加新硬盤 fdisk新建分區

fdisk新建分區:

[[email protected] ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk identifier: 0x000e7df7
 
  Device Boot      Start         End      Blocks  Id  System
/dev/sda1  *           1         511    4096000   83  Linux
Partition 1 does not end on cylinderboundary.
/dev/sda2             511        1020    4096000   83  Linux
Partition 2 does not end on cylinderboundary.
/dev/sda3            1020        1275    2048000   82  Linux swap / Solaris
/dev/sda4            1275        2611   10730496    5  Extended
/dev/sda5            1276        2611   10729472   83  Linux
 
Disk /dev/sdb: 21.5GB, 21474836480 bytes
255 heads, 63sectors/track, 2610 cylinders
Units = cylinders of16065 * 512 = 8225280 bytes
Sector size(logical/physical): 512 bytes / 512 bytes
I/O size(minimum/optimal): 512 bytes / 512 bytes
Disk identifier:0x00000000
[[email protected]
/* */ ~]# fdisk /dev/sdb 開始分區 Device contains neither a valid DOSpartition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with diskidentifier 0x6811b6b9. Changes will remain in memory only, untilyou decide to write them. After that, of course, the previous contentwon‘t be recoverable. Warning: invalid flag 0x0000 of partitiontable 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated.It‘s strongly recommended to switch off the mode (command ‘c‘) and change display units to sectors (command ‘u‘). Command (m for help): m #查看幫助 Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibilityflag d delete a partition l list known partition types m print this menu n add a new partition #添加一個新分區 o create a new empty DOSpartition table p print the partition table #查看當前分區情況 q quit without saving changes s create a new empty Sundisklabel t change a partition‘s system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (expertsonly) Command (m for help): n #添加一個新分區 Command action e extended p primary partition (1-4) p #主分區 Partition number (1-4): 1 #分區號 First cylinder (1-2610, default 1): 1 #柱面 Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +4G #分配大小(不以柱面方式) Command (m for help): p #查看一下 Disk /dev/sdb: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280bytes Sector size (logical/physical): 512 bytes /512 bytes I/O size (minimum/optimal): 512 bytes / 512bytes Disk identifier: 0x6811b6b9 Device Boot Start End Blocks Id System /dev/sdb1 1 523 4200966 83 Linux成功! Command (m for help): n #繼續添加分區 Command action e extended p primary partition (1-4) e #擴展分區 Partition number (1-4): 2 #分區號 First cylinder (524-2610, default 524): #默認起始柱面-回車 Using default value 524 Last cylinder, +cylinders or +size{K,M,G}(524-2610, default 2610): #默認結束柱面-回車 Using default value 2610 Command (m for help): p #查看一下 Disk /dev/sdb: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280bytes Sector size (logical/physical): 512 bytes /512 bytes I/O size (minimum/optimal): 512 bytes / 512bytes Disk identifier: 0x6811b6b9 Device Boot Start End Blocks Id System /dev/sdb1 1 523 4200966 83 Linux /dev/sdb2 524 2610 16763827+ 5 Extended #擴展分區成功! Command (m for help): n #繼續分邏輯分區 Command action l logical (5 or over) p primary partition (1-4) l #選邏輯分區 First cylinder (524-2610, default 524): #默認起始柱面-回車 Using default value 524 Last cylinder, +cylinders or +size{K,M,G}(524-2610, default 2610): #默認結束柱面-回車 Using default value 2610 Command (m for help): p #查看一下 Disk /dev/sdb: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280bytes Sector size (logical/physical): 512 bytes /512 bytes I/O size (minimum/optimal): 512 bytes / 512bytes Disk identifier: 0x6811b6b9 Device Boot Start End Blocks Id System /dev/sdb1 1 523 4200966 83 Linux /dev/sdb2 524 2610 16763827+ 5 Extended /dev/sdb5 524 2610 16763796 83 Linux #成功! Command (m for help): w #保存 The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [[email protected]
/* */ ~]# partprobe #重新讀取分區表信息 [[email protected] ~]# mkfs -t ext4 /dev/sdb1 #格式化 [[email protected] ~]# mkdir /disk1 /disk5 #創建兩個掛載點 [[email protected] ~]# mount /dev/sdb1 /disk1 #掛載 [[email protected] ~]# mount /dev/sdb5 /disk5 #掛載


開機自動掛載:

[[email protected] ~]# dumpe2fs /dev/sdb1 #查看分區UUID
dumpe2fs 1.41.12 (17-May-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          968fc705-506d-4977-a469-32be93467a97
[[email protected]
/* */ ~]# dumpe2fs /dev/sdb5 |more dumpe2fs 1.41.12 (17-May-2010) Filesystem volume name: <none> Last mounted on: <not available> Filesystem UUID: 987dd564-5d12-4d0b-9706-c5bdf860e927 # # /etc/fstab # Created by anaconda on Wed Jan 6 23:44:24 2016 # # Accessible filesystems, by reference, aremaintained under ‘/dev/disk‘ # See man pages fstab(5), findfs(8),mount(8) and/or blkid(8) for more info [[email protected] ~]# vim /etc/fstab # UUID=b943e84c-2d74-4098-85ed-096353ff1815/ ext4 defaults 1 1 UUID=4f4b30ad-e3e4-45c3-bb60-6f6c0dd8cd62/boot ext4 defaults 1 2 UUID=41c2e8a6-10f0-4a10-b1a8-fe8db32ce708/home ext4 defaults 1 2 UUID=289dd6bc-687b-48e9-9d10-e34aa360228fswap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 UUID=968fc705-506d-4977-a469-32be93467a97/disk1 ext4 defaults 12 /dev/sdb5 /disk5 ext4 defaults 1 2 [[email protected] ~]# mount –a #測試一下,所有分區按照配置文件/etc/fstab 重新掛載一次 /etc/fstab

文件錯誤時修復:

[[email protected] ~]# mount -o remount,rw / #重新將/掛載成讀寫權限,只用於
/etc/fstab
文件錯誤修復時。





Linux添加新硬盤,fdisk新建分區

相關推薦

Linuxfdisk新建

linux添加新硬盤 fdisk新建分區 fdisk新建分區:[[email protected]/* */ ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 c

Linux格式化掛載

ima 命令 啟動 ads bash 分區 tab class comm 1、查看分區信息: [[email protected]/* */ /]# fdisk -l Disk /dev/vdb: 209.7 GB, 209715200000 bytes1

Linux系統設置啟動自動掛載圖文教程!

自動掛載 令行 主機 mkf image 根目錄 分區 分享 教程 虛擬機添加硬盤的步驟就不多廢話了,主要列出添加硬盤後要進行設置的幾個詳細步驟: 1.查看磁盤信息:fdisk -ls 添加前如下圖所示: 添加後如下圖: 也可以用:ls /dev/sd*查看,如下圖:

給虛擬機fdisk查看重新讀取表信息partprobe格式化掛載查看掛載信息

strip lvm misc ces e2fs ice sdi ted emp 1.虛擬機關機斷電 2.添加硬盤 2.開機 3.fdisk -l查看剛才新添加的硬盤 [[email protected]/* */ ~]# fdisk -l 磁盤

aws 和ubuntu方法

命令 新硬盤 mkdir mnt 查看 編輯 uuid one 可能 1.現在 aws 網站上創建一個硬盤,註意創建的Availability Zone必須和EC2 虛擬機在同一個區,因為一個AZ相當於一個數據中心,為了保證速度,不可能把硬盤和虛擬機放在不同的數據中心。 2

利用MegaCli工具在線做RAID0

bst size dsta num list gic 外部 ada pset 1、MegaCLI工具的安裝 # rpm -ivh MegaCli-8.07.14-1.noarch.rpm # rpm -ql MegaCli /opt/MegaRAID/MegaCli/Meg

linux虛擬機上虛擬

硬盤 加載 作文件 拓展 多個 filesyste 完成 spa 空間 添加虛擬硬盤 指定磁盤空間 成功在虛擬機中添加了一塊20G的硬盤。在linux中這樣定義sda為第一塊硬盤,第二塊硬盤為sdb,以此類推。Sda1為第一塊硬盤的第一分區。 linux上的分

在centos7上就對進行掛載等操作 (實驗自用)

and known 是否 guid ima .com exit 一次 clas ??1.在虛擬機上添加一個新的硬盤 ??2. 為了讓在系統裏能夠顯示新添加的硬盤已知有兩種操作方法? ? ? ? ?1.重啟? ? ? ? 2.輸入 echo "- - -&quo

VMware下Windows Server 2012

.cn src vsp 磁盤管理 stand 一個 資料 登錄 虛擬 系統管理員在VM下新裝了一臺Windows Server 2012服務器,我在上面安裝了SQL Server 2014 Standard版數據庫,安裝之初,只分配了一個C盤,我想在這臺服務器上添加了三個磁

Linux 用戶(user)組(Group)以及權限(Permission)

opened 用戶 信息 groupdel upa ide 登陸 play cnblogs 1. 添加用戶 sudo adduser UserName 異常: sudo adduser --force-badname <username

ECShop模塊管理權限報錯

ren 權限 方法 nbsp argument php dmi join() all 提示報錯信息: Warning: join(): Invalid arguments passed in D:\phpStudy\WWW\TimmyMall\admin\privilege

如果centos7網卡系統不識別的解決辦法

png entos ifcfg-eth gateway clear size http res sco #ifconfig 2.獲取新增網卡的真實mac #ip addr 3.復制eth0到eth1並修改配置文件 #cd /etc/sys

在ubuntu 16.04 的vm中網卡同一網段不同ip

ubuntu linux ip在ubuntu 16.04 的vm中新加了一塊網卡,但是不顯示,用ifcnfig -a 可以看到,執行 $ifconfig ens38 up 顯示錯誤 在網上查看可以重新安裝vmtools來重新安裝網卡驅動1、加載光驅 $sudo mkdir /mnt/cdrom $sudo m

linux的安裝及fdisk

硬盤分區 fdisk 摘要:本文將通過虛擬機VMware模擬增加新硬盤來介紹linux下對新增硬盤的分區及安裝。在本文中,將通過虛擬機增加一個10G的SCSI接口的虛擬硬盤,然後對這塊新的虛擬硬盤建立3個分區,在第1個和第3個分區上建立ext3fs文件系統,把第2個分區留作swap交換分區。首先,將硬

關於電腦安裝出現無法是識別設備03F0問題解答。

col 無法 圖片 合並 新的 分區表 font height 文件格式 問題說明:在添加新的硬盤,切確定硬盤沒有壞的情況下,無法識別出新的硬盤。 解決方案: 1.檢查bios系統裏的安全模式,是否處於開啟中。因為在windows 8.1以上的版本中,不開啟的情況

AIX 刪除

AIX 添加刪除硬盤添加硬盤方式一:關機添加硬盤,完成操作後,啟動AIX系統。用lspv查看。方式二:不關閉系統 1.#lspv hdisk0 000b1fbf47874c2c rootvg active 2.#cfgmgr 3.#lspv

在CentOS7下及創建

host centos default oot 自動 def class 自動掛載 空間 1、無需重啟擴展空間[root@centos1 ~]# ls /sys/class/scsi_host/host0 host1 host2[root@centos1 ~]# ech

在虛擬機CentOS 7中而不用重啟系統

sca class int 總線 檢查 不用 虛擬 通過 掃描 現在運行如下命令,通過重新掃描 SCSI (註:Small Computer System Interface 小型計算機系統接口)總線並添加 SCSI 設備,系統就可以擴展操作系統的物理卷磁盤空間,而且不需要

新增磁創建掛載

格式 -h mkf disk ont fault style rtp 添加 1、添加磁盤 2、查看磁盤:fdisk -l  (新增磁盤為/dev/x) 3、管理磁盤:fdisk /dev/x,根據提示創建分區 4、查看磁盤,查看新建分區 5、格式化分區:mkfs.xfs /

linux fdisk 掛載永久掛載

硬盤 直接 linux 之前 gpt sda 自動生成 gpo path 1、SSH登陸服務器: 2、列出所有硬盤:   命令:ll /dev/disk/by-path 我這裏還有個sda 3、查看磁盤分區情況: 命令 :fdisk -l 最上面兩部分表示我有兩個物理設