首页 > Linux操作系统 > Linux操作系统 > Linux新加盘识别并分区
添加硬盘并查看
# echo "scsi add-single-device 0 0 1 0" >/proc/scsi/scsi
删除硬盘并查看
步骤4 格式化分区
步骤5:创建目录然后将该分区加挂到该目录下
步骤6:修改/etc/fstab文件添加如下记录使系统每次重启后都能自动加载该分区
步骤7:
[root@rac1 /]#vi /etc/fstab
/dev/sdb1 /u01 ext3 defaults 1 2
说明:
若新加硬盘的时候选择了创建逻辑盘(即选择了e)的时候,格式话的时候会报如下错误:
mkfs -t ext3 -c /dev/sdb1
这是因为我们这里只创建了逻辑盘,没有创建逻辑分区,所以创建完逻辑盘后还需要创建逻辑分区:
[root@hxl oracle]# fdisk /dev/sdb
The number of cylinders for this disk is set to 2088.
Command (m for help): m
Command (m for help): n
Command (m for help): w
Calling ioctl() to re-read partition table.
Disk /dev/sda: 21.4 GB, 21474836480 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdb: 17.1 GB, 17179869184 bytes
Device Boot Start End Blocks Id System
Checking for bad blocks (read-only test): done
This filesystem will be automatically checked every 21 mounts or
Disk /dev/sda: 21.4 GB, 21474836480 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdb: 17.1 GB, 17179869184 bytes
Device Boot Start End Blocks Id System
linux中开机挂载,挂载错了,怎么修改
1。进入Linux单用户模式
执行 root# mount -o remount,rw /
然后/etc/fstab就可以修改了
# fdisk -l
# echo "scsi remove-single-device 0 0 1 0" >/proc/scsi/scsi
# fdisk -l
在文件的末尾填加如下内容
Invalid argument passed to ext2 library while setting up superblock.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
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
m print this menu
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 action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-2088, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2088, default 2088):
Using default value 2088
The partition table has been altered!
Syncing disks.
[root@hxl oracle]# fdisk -l
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sda1 * 1 1000 8032468+ 83 Linux
/dev/sda2 1001 1200 1606500 82 Linux swap / Solaris
/dev/sda3 1201 2610 11325825 83 Linux
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sdb1 1 2088 16771828+ 5 Extended
/dev/sdb5 1 2088 16771797 83 Linux
[root@hxl oracle]# mkfs -t ext3 -c /dev/sdb5
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2097152 inodes, 4192949 blocks
209647 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
128 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@hxl oracle]# fdisk -l
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sda1 * 1 1000 8032468+ 83 Linux
/dev/sda2 1001 1200 1606500 82 Linux swap / Solaris
/dev/sda3 1201 2610 11325825 83 Linux
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sdb1 1 2088 16771828+ 5 Extended
/dev/sdb5 1 2088 16771797 83 Linux
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29119577/viewspace-1279556/ ,如需转载,请注明出处,否则将追究法律责任。