linux没有系统如何删除sda,Linux:解决U盘可以识别,但在/dev目录下只有sda,却无设备节点(sda1)的问题...
問題:U盤接入,系統可以識別,但在/dev目錄下只有sda(或其他),卻無設備節點sda1(或其他)?
解決:
(1)查看U盤是否分區
#fdisk /dev/sda /*進入fdisk命令操作空間*/
#Command (m for help): m /*命令查看*/
Command action
a toggle a bootable flag #設置引導扇區
b edit bsd disklabel #編輯卷標(linux下使用的卷標bsd通用)
c toggle the dos compatibility flag
d delete a partition #刪除分區
l list known partition types #列出已知的分區類型
m print this menu
n add a new partition #添加一個新的分區
o create a new empty DOS partition table #生成一個新的空DOS分區列表
p print the partition table #打印分區列表
q quit without saving changes #不保存退出
s create a new empty Sun disklabel
t change a partition's system id #改變一個分區列表的ID
u change display/entry units
v verify the partition table
w write table to disk and exit #寫入列表到磁盤并退出
x extra functionality (experts only)
#Command (m for help): p
Disk /dev/sda: 8178 MB, 8178892800 bytes
252 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15624 * 512 = 7999488 bytes
Device Boot Start End Blocks Id System /*可見U盤無分區*/
(2)若未分區,創建分區sda1,并格式化(也可以不進行格式化)
#fdisk /dev/sda
Command (m for help): m
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
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 (experts only)
Command (m for help): n /*n表示添加一個新的分區*/
Command action
e extended /*創建擴展分區*/
p primary partition (1-4) /*創建主分區*/
p
Partition number (1-4): 1 /*輸入主分區號,這里設置為1*/
First cylinder (1-1022, default 1): Using default value 1 /*起始,回車使用默認值*/
Last cylinder or +size or +sizeM or +sizeK (1-1022, default 1022): Using default value 1022 /*結尾,回車使用默認值*/
Command (m for help): p /*p表示打印分區列表*/
Disk /dev/sda: 8178 MB, 8178892800 bytes
252 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15624 * 512 = 7999488 bytes
Device Boot Start End Blocks Id System /*可見sda1分區已創建*/
/dev/sda1 1 1022 7983833 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table
#mkfs -t vfat /dev/sda1 /*對sda1進行格式化(也可以不進行這一步)*/
mkfs.vfat 3.0.12 (29 Oct 2011)
mkfs.vfat: /dev/sda1 contains a mounted file system.
#fsck -t vfat /dev/sda /*格式化完成后對U盤進行修復*/
fsck from util-linux 2.20.1
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
Logical sector size (64543 bytes) is not a multiple of the physical sector size.
(3)前兩步完成后,在/dev目錄下將會出現設備節點sda1;如果沒有,則手動創建設備節點sda1
#mknod /dev/sda1 b 8 1 /*手動創建設備節點sda1*/
#mount /dev/sda1 /mnt/udisk /*掛載U盤到/mnt/udisk目錄下*/
#umount /mnt/udisk /*卸載U盤*/
總結
以上是生活随笔為你收集整理的linux没有系统如何删除sda,Linux:解决U盘可以识别,但在/dev目录下只有sda,却无设备节点(sda1)的问题...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: web浏览器 DNS服务器 web服务器
- 下一篇: php验证是否为整数(0、正整数、负整数