Creating and Formatting Partitions with FDISK and mkfs - BASH - Linux

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] okay today we're going to be looking at basically creating partitions and formatting them it's pretty simple uh although be can be kind of scary and we're going to be doing it from the command line obviously a lot of you probably already know how to use stuff like uh g-p parted and other gooey interfaces uh but I'm going to show you how to do it from the command line pretty simple first things first let me uh plug in a flash drive here which is empty but already formatted to a uh fat 16 I believe format I plug it in and mint will automatically mount it right there you can see it's empty I'm just going to close that window if I type in my terminal Mount gives me a list of all my mounted information and right here you can see that drive uh is uh a fat a vat format and its device name is uh SDC and it's sdc1 for partition one so first thing we're going to do let me clear the screen here we're going to type in pseudo Fisk device SDC we don't want to put the one because we want to uh work with Device not the format in this case we'll hit enter and if I hit P it'll give me a list of all the partitions there's only one on this drive but if there was more than one they'd be listed here and what formats they are in and their size where they start and end um so let's quickly let's just delete that that partition we'll hit D we'll hit enter and it says selected one now if you have more than one partition it will ask you which partition uh one two three or four in most cases and you just press one or two or three or whichever partition you want and you can do more than one partion partition at a time you hit D pick a number then hit D again and pick another number and if there's only one partition left it won't ask you for a number so uh we hit D we selected partition one we'll just hit W and hit enter now to write and exit out that now if we go back into it and we hit P for partition table you'll see there are no partitions so let's quickly create a um uh EXT partition so we will just say uh n for new it's asking if you want to make a primary partition or an extended partition most cases you're going to want a primary partition you can have up to four we'll hit P there it says partition number we'll just say one and then it's going to ask for first and last cylinder that's where this partition is going to be on the drive since we're only putting one we're going to hit enter the default is one so we'll just hit enter and it'll put in one and it's going to ask where you want that to end so you know if you were going to have uh more than one partition I can say plus 10 m to make this 10 megabytes if I want it and then it would leave the rest of the drive blank so I can create other partitions but I'm just going to hit enter and we'll do the default and just make the partition the enti entire size of the drive at at this point I can hit W for write so it will write that information cuz whenever you're doing stuff in in uh Fisk it does not take effect on the drive until you write it so w for write now uh we still want to part uh we have created the partition but we haven't formatted it yet so let's do mkfs for make fil system. EXT we'll hit tab a few times you can see that we have a few options here uh EXT2 three or four let's just go with four in this case and of course the partition name so SL deev SL uh s um excuse me SD uh C and it's partition one make sure you pick the right partition because this will erase the information on that drive so if you have more than one partition or you put the wrong device so just cuz I'm doing SDC doesn't mean that it's going to be SDC on your device uh you might have more uh drives plugged in and the order you plug them in they're going to give them different letters so make sure when you're doing all of this you're using the device that you want to be doing so we'll hit enter there oh it says it's mounted so let's unmount it real quick I don't remember mounting it there we go now we'll do this and of course we have to pseudo that sorry that sorry about that pseudo mkfs XT in this case 4 and my device name all the way down to the partition hit enter take a few seconds here and it is partitioning perfect and you can see right here this will automatically check uh every 31 mounts or 180 days for errors you can override that by using uh tune to FS which is a program we're going to play with in tutorials in the next week or so so uh let me open up my window here you can see now I have this ext4 partition here so it worked uh EXT partitions automatically put that folder in there that lost found folder for you um so let's unmount that drive so um Mount device sdc1 and let's create a fat partition um lots of times you're going to want to create a fat partition if you're going to want this device to work on multiple operating systems fat uh partitions are in Microsoft format they're not the best out there they're kind of outdated they are very good about uh being um defragged they they get defragged very easily um I'm sorry they get fragmented easily so you have to defrag them but on a flash drive it doesn't really matter especially if you want to uh be able to copy files in Windows and other operating systems in on a flash drive you're going to want to go with some sort of fat format so real quick here let's go uh pseudo Fisk device SDC once again not putting in that number because we're not going to work with a partition we're going to work with the whole device if we hit P right here like I said it will show you that the the partition name where it starts ends and what format it is EXT is a Linux system so let's hit D and delete that and although I don't think you have to I like to write at that point rather than continuing with the process although you could probably continue the process without writing so going back into Fisk here so pseudo Fisk and the device we'll say n for new P for primary one we'll just use the default and use the whole drive now at this point we can hit t for type so this is the type of partition is going to be and if we hit L at this point it'll give you a list of all possible uh types that you could use you can see there's a lot I'm just going to go with six for fat 16 so I'll press six and hit enter now if I write it it created that partition but once again we still need to format it so in this case we're going to go mkfs for make file system. vfat and the partition name which is uh device sdc1 and we should do pseudo for that as well hit enter and that's it that partition is created uh let me open up my window over here again and you can see that it's an empty drive it's a fat 32 and we can also check that by typing Mount and hitting enter and you can see right here device and type and some other information there so that is creating partitions and formatting them from the command line in Linux uh to different formats so I thank you for watching please visit films by chris.com that's Chris with a K there's a link in the description to uh this post which might have a little more information and also on my site you can look through playlists and search for different videos and topics I thank you for watching and I hope that you have a great [Music] day
Info
Channel: Kris Occhipinti
Views: 202,969
Rating: undefined out of 5
Keywords: Linux, BASH, shell, script, commandline, cli, programing, design, development, open, source, free, code, tutorial, howto, computers, hacking
Id: 5kVAzxTwy5Q
Channel Id: undefined
Length: 8min 21sec (501 seconds)
Published: Fri Feb 25 2011
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.