linux添加新硬盘、格式化以及自动挂载
2017-01-16 14:25
543 查看
[root@hdd4 ~]# fdisk /dev/vdb anaconda-ks.cfg .bash_profile .pki/ .bash_history .bashrc .tcshrc .bash_logout .cshrc .viminfo [root@hdd4 ~]# fdisk /dev/vdb #下面操作把硬盘所有容量设置为一个分区 Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xc19c6a55. Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): First sector (2048-629145599, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-629145599, default 629145599): Using default value 629145599 Partition 1 of type Linux and of size 300 GiB is set Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@hdd4 ~]# mkfs -t ext4 /dev/vdb1 #格式化/vdb1分区 mke2fs 1.42.9 (28-Dec-2013) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 19660800 inodes, 78642944 blocks 3932147 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2227175424 2400 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done [root@hdd4 ~]# mkdir /data [root@hdd4 ~]# mount /dev/vdb1 /data [root@hdd4 ~]# chown -R /data chown: missing operand after ‘/data’ Try 'chown --help' for more information. [root@hdd4 ~]# chown -R hadoop:hadoop /data [root@hdd4 ~]# [root@hdd4 ~]# [root@hdd4 ~]# blkid /dev/ Display all 152 possibilities? (y or n) [root@hdd4 ~]# blkid /dev/vdb1 /dev/vdb1: UUID="b112cf72-a0a4-45cc-88be-afdc24a1e635" TYPE="ext4" [root@hdd4 ~]# cat /etc/fstab # # /etc/fstab # Created by anaconda on Tue Dec 20 14:35:53 2016 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/centos-root / xfs defaults 0 0 UUID=82b43f00-0de4-4571-b093-654128268c31 /boot xfs defaults 0 0 /dev/mapper/centos-swap swap swap defaults 0 0 UUID=b112cf72-a0a4-45cc-88be-afdc24a1e635" TYPE="ext4 /data ext4 defaults 0 0 [root@hdd4 ~]# [root@hdd4 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 18G 3.2G 15G 18% / devtmpfs 16G 0 16G 0% /dev tmpfs 16G 0 16G 0% /dev/shm tmpfs 16G 89M 16G 1% /run tmpfs 16G 0 16G 0% /sys/fs/cgroup /dev/vda1 497M 108M 390M 22% /boot tmpfs 3.2G 0 3.2G 0% /run/user/1000 tmpfs 3.2G 0 3.2G 0% /run/user/0 /dev/vdb1 296G 65M 281G 1% /data
相关文章推荐
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- 20151117 Linux下磁盘管理(centos 6.5)1.添加硬盘 2.硬盘分区 3.格式化硬盘 4.挂载硬盘 5.设置开机自动挂载】
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加硬盘与fdisk分区、mke2fs格式化分区、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- linux格式化新硬盘并挂载,设置开机自动挂载
- Linux系统添加硬盘设备(磁盘分区-格式化-挂载-使用)
- linux硬盘的分区、格式化、挂载以及LVM
- linux 下添加新硬盘设备和硬盘分区格式化挂载使用磁盘配额限制
- Linux下C语言来检测USB设备以及自动区分U盘和硬盘并自动挂载
- linux下如何挂载硬盘 以及让硬盘开机自动挂载
- 给linux虚拟机添加硬盘,分区,格式化,挂载