TurboLinux11添加新硬盘方法
番茄系统家园 · 2022-09-28 01:14:14
中当前连接的硬盘
设备和分区信息.新硬盘没有分区信息,则只显示硬盘大小信息.
好硬盘后,开机进入Turbolinux.以root身份登录.
执行fdisk -l命令显示当前的硬盘设备.
[root@g11-64-1 ~]# fdisk -l
Disk /dev/hda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device BootStart EndBlocks IdSystem
/dev/hda1 * 113104391 83Linux
/dev/hda21489610470 82Linux swap / Solaris
/dev/hda390261020249932+83Linux
Disk /dev/hdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/hdb doesn't contain a valid partition table
[root@g11-64-1 ~]#
显示hdb没有分区信息,大小为10G.
使用fdisk命令对hdb进行分区.
[root@g11-64-1 ~]# fdisk /dev/hdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to 1305. 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) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 输入: n 表示新建分区. Command (m for help): n Command action e extended p primary partition (1-4) 输入: p 表示建立一个原始分区. p Partition number (1-4): 1 输入: 1 表示此分区编号为1. First cylinder (1-1305, default 1): 输入: 回车 表示使用默认起始柱面号. Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): 输入: 回车 表示使用默认结束柱面号.即此分区使用整个硬盘空间. Using default value 1305 Command (m for help): w 输入: w 存盘,退出fdisk. The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
再使用fdisk -l命令查看分区情况.
[root@g11-64-1 ~]# fdisk -l Disk /dev/hda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device BootStart EndBlocks IdSystem /dev/hda1 * 113104391 83Linux /dev/hda21489610470 82Linux swap / Solaris /dev/hda390261020249932+83Linux Disk /dev/hdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device BootStart EndBlocks IdSystem /dev/hdb1 1130510482381 83Linux
显示/dev/hdb上有一个hdb1分区,为linux格式.
分区后,需要对这个分区进行格式化.
[root@g11-64-1 ~]# mkfs.ext3 /dev/hdb1 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 1310720 inodes, 2620595 blocks 131029 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2684354560 80 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 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 39 mounts or 180 days, whichever comes first.Use tune2fs -c or -i to override.
将新建分区挂在到/mnt/hdb1上.
[root@g11-64-1 ~]# mkdir /mnt/hdb1 [root@g11-64-1 ~]# mount /dev/hdb1 /mnt/hdb1 [root@g11-64-1 ~]# df -h FilesystemSizeUsed Avail Use% Mounted on /dev/hda319G8.2G9.7G46% / /dev/hda199M 16M 79M17% /boot tmpfs 250M 0250M 0% /dev/shm /dev/hdb1 9.9G151M9.2G 2% /mnt/hdb1 [root@g11-64-1 ~]#
hdb1已挂载到/mnt/hdb1上,剩余空间为9.2G.
在此分区上创建文件.
[root@g11-64-1 ~]# cd /mnt/hdb1 [root@g11-64-1 hdb1]# ls > a [root@g11-64-1 hdb1]# ls -hl total 20K -rw-r--r-- 1 root root13 Nov3 08:45 a drwx------ 2 root root 16K Nov3 08:44 lost+found [root@g11-64-1 hdb1]#
卸载hdb1分区.
[root@g11-64-1 hdb1]# cd [root@g11-64-1 ~]# umount /mnt/hdb1 [root@g11-64-1 ~]# df -h FilesystemSizeUsed Avail Use% Mounted on /dev/hda319G8.2G9.7G46% / /dev/hda199M 16M 79M17% /boot tmpfs 250M 0250M 0% /dev/shm [root@g11-64-1 ~]#
新硬盘开机自动挂载
在/etc/fstab中添加新硬盘的挂载信息.添加下面一行:
/dev/hdb1 /mnt/hdb1 ext3 defaults 1 2
这样,每次开机后,会自动将/dev/hdb1挂载到/mnt/hdb1上.
免责声明: 凡标注转载/编译字样内容并非本站原创,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如果你觉得本文好,欢迎推荐给朋友阅读;本文链接: https://m.nndssk.com/xtwt/197266i1Gds4.html。
