Linux添加新硬盘、分区、格式化、自动挂载

毕设分享|基于16单片机的指纹识别电子密码锁设计 我们今天的工作生活中,很多的场合都需要身份的认证,而传统的基于标志的身份认证技术由于受到证件伪造以及密码破解等手段的威胁,逐渐表现得有些力不从心。怎样保护自己的重要文件资料,如何保证自己的隐私不被泄露?在传统的身份认证中,我们往往使用密码加密法,但是这种方法只是"防君子不防小人"。在高明的黑客眼里,由几个字符组成的密码脆弱得不堪一击。现在,科技的发展让我们有了新的选择——生物识别技术。将生物识别技术应用于笔记本、门锁等方面,可以对文件、财产起保护作用,并且可以进行身份识别。 阅读详情
 
第一步:创建分区
    root# fdisk  /dev/had        进入到新添加的硬盘中
The number of cylinders for this disk is set to 10402.
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 (m for help): n           创建新分区
 Command action
   e   extended
   p   primary partition (1-4)
p                             创建主分区
Partition number (1-4): 1          新建的主分区序号
First cylinder (1-10402, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-10402, default 10402): +500M   à创建主分区大小
 
Command (m for help): w       保存创建的主分区
第二步:使新创建的分区在系统中立即生效
 root#partprobe
 
第三步:格式化新创建的分区
[root@server ~]# mkfs.ext3 /dev/hda1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
122400 inodes, 488848 blocks
24442 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
60 block groups
8192 blocks per group, 8192 fragments per group
2040 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
 
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@server ~]#
 
第四步:使新创建的分区挂载/mnt/rhce01 目录下
Root#mount /dev/hda1 /mnt/rhce01
 
 
第五步:让挂载在系统重启后仍然有效
root# vim /etc/fstab       编辑这个文件,添加上下面的一行,使挂载在重启后有效;  
LABEL=/1                /                       ext3    defaults        1 1
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
LABEL=SWAP-sda3         swap                    swap    defaults        0 0
/dev/hda1              /mnt/rhce01              ext3    defaults        0 0
 
 
 
另:
 
在为主机添加硬盘前,首先要了解Linux系统下对硬盘和分区的命名方法。  在Linux下对SCSI的设备是以sd命名的,第一个scsi设备是sda,第二个是sdb。依此类推
  一般主板上有两个SCSI接口,一共可以安装四个SCSI设备。主SCSI上的两个设备分别对应sda和sdb,第二个SCSI口上的两个设备对应sdc和sdd。
      一般硬盘安装在主SCSI的主接口上,所以是sda或者sdb,光驱一般安装在第二个SCSI的主接口上,所以是sdc.
  (IDE接口设备是用hd命名的,第一个设备是hda,第二个是hdb。依此类推.)
  分区是用设备名称加数字命名的。例如hda1代表hda这个硬盘设备上的第一个分区。
  每个硬盘可以最多有四个主分区,作用是1-4命名硬盘的主分区。逻辑分区是从5开始的,每多一个分区,数字加1就可以。
1、给硬盘分区
fdisk /dev/sda
Command (m for help): n
Command action
e extended
p primary partition (1-4)
输入:e
Partition number (1-4): 1
First cylinder (1-9729, default 1):回车
Last cylinder or +size or +sizeM or +sizeK (1-9729, default 9729):回车
Command (m for help):w(保存退出)
2、格式化硬盘
fdisk -l
mkfs -t ext3 /dev/sda1
Writing superblocks and filesystem accounting information:直接回车。
3、挂载
mount /dev/sda1 /test
4、开机直接挂载
编辑/etc/fstab 文件
添加:/dev/sda1 /test ext3 defaults 1 1
重启则发选已经挂载上去。
你学Simulink--基于储能系统的建模与仿真场景:飞轮储能系统在电网调频中的作用仿真 本文详细介绍了利用Simulink+Simscape搭建飞轮储能系统(FESS)电网调频仿真模型的全过程。主要内容包括:系统工作原理及调频作用分析,基于Simulink的模块化建模步骤(飞轮、电机/发电机、功率电子接口等组件搭建),调频控制策略实现(频率检测、功率指令生成和模式切换),以及仿真参数设置与结果分析方法。该模型可有效模拟FESS在电网频率调节中的快速响应特性,为新能源存储和智能电网研究提供重要仿真工具,同时可通过参数优化和算法改进进一步提升系统性能。 阅读详情

相关推荐

AD936x Evaluation Software 实战配置指南:从寄存器设置到滤波器优化

本文提供AD936x Evaluation Software的实战配置指南,详细解析从工程创建、RF向导与时钟模块配置,到数字滤波器优化、数字接口设置及增益控制的完整流程。重点分享寄存器设置、滤波器系数权衡及PLL稳定技巧等核心要点,帮助开发者高效配置AD9361/AD9363射频芯片,快速应用于SDR、基站等场景。

perl8的博客 697

Linux利用fdisk工具磁盘分区及挂载

Linux利用fdisk工具磁盘分区及挂载

fengyudream的博客 394

从高德、百度地图下载POI数据?用这个工具5分钟搞定GCJ02/BD09到WGS84的坐标纠偏

本文详细解析了高德、百度地图POI数据坐标偏移问题,并提供了从GCJ02/BD09到WGS84的高效转换方案。通过开源工具如coordtransform和ArcGIS等专业软件,实现毫米级精度的坐标纠偏,适用于商业选址、GIS分析等场景,显著提升数据准确性和工作效率。

weixin_26789847的博客 450

Linux主机硬盘格式化命令,Linux下硬盘格式化的相关命令Partprobe

这几天格式化硬盘,记录一下用到的命令:[root@db ~]#fdisk /dev/sdbThe number of cylinders for this disk is set to 253981.There is nothing wrong with that, but this is larger than 1024,and could in certain setups cause pro...

weixin_34697798的博客 559

Vivado加上VsCode让你的生活更美好

VsCode与Vivado的灵活使用 引言 ​ 现在大二了,在接触硬件描述语言。Vivado自带的编辑器实在很难用,为了能够“极客”一些,当然是去Google了一下有哪些方法可以取而代之。 ​ 网络上的答案大同小异,基本上都是用的Sublime Text.(我的学长们也几乎都是) 平时码代码的过程中,我习惯与使用VsCode,尤其是在微软收购GitHub之后,Code 简直就是神器了。于是乎…一个...

qq_39498701的博客 10万+

OrangePi Kunpeng Pro 安装 ROS2 + Gazebo

OrangePi Kunpeng Pro 的优点很明显,内置openEuler,配备PD电源,做到开箱即用;板子设计也不错,风扇噪音不大,散热良好,昇腾芯片又确保小板子的性能,接口丰富是这类板子共同的优点,也很好的继承了下来,甚至还可以外接固态,可靠性大大提升。使用起来,哪怕不用openEuler的话,也可以很方便的刷Ubuntu来实现一些需要依赖的开发工作,这次没有跑AI模型,所以对算力的优势还没有很明显的感受,下次可以试一下yolo跑跑看。

Arcan 1824

linux 添加新分区,Linux添加新硬盘、分区、格式化、自动挂载

第一步:创建分区root#fdisk/dev/hadà进入到新添加的硬盘中The number of cylinders for this disk is set to 10402.There is nothing wrong with that, but this is larger than 1024,and could in certain setups cause problems wit...

weixin_39955829的博客 293

嵌入式开发也玩“全家桶”?手把手教你用CLion+PyOCD调试APM32,比OpenOCD更简单

本文详细介绍了如何使用CLion和PyOCD组合进行APM32嵌入式开发,提供从环境配置到实战调试的完整指南。相比传统工具如Keil和OpenOCD,这套方案更轻量、易用,特别适合现代开发者需求,涵盖CMake配置、PyOCD调试技巧及常见问题解决。

weixin_42543046的博客 464

sd卡linux挂载设备名,如何在linux下挂载U盘或者SD卡等设备

最近在开发的过程中需要使用到sd卡的挂载,之前虽然也挂载过,但是由于过去的时间太长了,很多 的步骤都变得模糊不清了,于是搜集整理了一下,也是对知识的一个总结吧 。Linux下给挂载U盘使用U盘时,U盘这个文件目录是不能直接进入的,我们需要对其进行挂载,然后再接下来的使用中就可以直接进行使用了。通过再网上查资料,现将U盘在Liunx下的挂载方法记录下来;第一步:插入U盘,如果能够识别出U盘,则会打印...

weixin_35410644的博客 500

ARFoundation系列讲解-教程目录

一、教程目录 ARFoundation快速入门-01简介 ARFoundation快速入门-02环境搭建 ARFoundation快速入门-03环境配置之iOS ARFoundation快速入门-04环境配置之Android ARFoundation快速入门-05ARKit设备支持列表 ARFoundation快速入门-06ARCore设备支持列表 ARFoundation快速入门-07检查设备支持 ARFoundation快速入门-08平面检..........

a451319296的博客 3万+

减法平均优化器(SABO)算法详解:从数学原理到工程应用

减法平均优化器(SABO)是一种基于数学概念的新型元启发式优化算法,由Trojanovský和Dehghani于2023年提出。该算法通过v-减法运算和平均值计算实现搜索优化,核心创新是采用目标函数值差异符号引导搜索方向。SABO具有参数少、结构简单、收敛快等特点,在高维复杂问题中表现优异。算法通过种群平均值保持多样性,利用符号函数确保搜索方向改进,自然平衡探索与开发。MATLAB实现显示其计算复杂度为O(N²·D),与主流群体智能算法相当。SABO不依赖生物或物理隐喻,数学基础坚实,在工程优化和机器学习领

qq_42212808的博客 165

VirtualBox安装Ubuntu搭建AOSP开发环境:从零到编译就绪

在Android系统开发领域,搭建一个稳定高效的Linux编译环境是深入AOSP源码研究的首要步骤。其核心原理在于通过虚拟化技术,在宿主机上创建一个隔离、可复现的Linux系统,为后续的源码下载、编译和调试提供基础平台。对于AOSP这类大型项目,环境配置的规范性直接决定了编译成功率和开发效率。采用VirtualBox虚拟机配合Ubuntu LTS系统,是兼顾免费、跨平台与稳定性的经典技术方案,尤其适合个人开发者和学习者在Windows或macOS上进行Android系统定制。本文聚焦于如何通过Virtual

weixin_33724570的博客 367

HFSS实战项目——微带带通滤波器设计

本文详细介绍并设计了一款微带带通滤波器,通过HFSS三位电磁仿真软件对其进行仿真设计及优化,仿真结果表明,本文设计的滤波器表现出优良的滤波性能,符合设计要求。

2401_87464239的博客 5393

java linux 格式化磁盘,Linux添加新硬盘、分区、格式化、自动挂载

在为主机添加硬盘前,首先要了解Linux系统下对硬盘和分区的命名方法。1) 在Linux下对SCSI的设备是以sd命名的,第一个ide设备是sda,第二个是sdb,依此类推。一般主板上有两个SCSI接口,一共可以安装四个SCSI设备。主SCSI上的两个设备分别对应sda和sdb,第二个SCSI口上的两个设备对应sdc和sdd。一般硬盘安装在主SCSI的主接口上,所以是sda或者sdb,光驱一般安装...

weixin_39687621的博客 257

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 效果比较好的js小日历
下一篇: 初识linux的shell
php_897721669
博客等级 码龄15年 32粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值