partitiondisk This is a topic that many people are looking for. faithandmedia.org is a channel providing useful information about learning, life, digital marketing and online courses …. it will help you have an overview and solid multi-faceted knowledge . Today, faithandmedia.org would like to introduce to you Creating and Formatting Partitions with FDISK and mkfs – BASH – Linux. Following along are instructions in the video below:
“Okay today we re going to be looking at basically creating partitions and formatting them. Them. It s pretty simple although b can be kind of scary. And we re to be doing from the command line.
Obviously a lot of you probably already you know how use stuff like gparted and other gui interfaces are going to show you i do it from the command line pretty simple first things first let me plug in a flash drive here. Which is empty. But our a formatted to a fat 16. I believe format plug it in and mint will automatically mount it right there you can see it s empty you re 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 is a fat av fat format. And it s device name is sdc and it s sdc. One for partition one so the first thing we re going to do let me clear. The screen here we re going to type in sudo fdisk device sd.
See we don t want to put the 1 because we want to 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 re in and their size. Where they start and end so let s quickly let s just delete that that partition will hit d.
We ll hit enter and it says select in one now. If you have more than one partition. We ll ask you which partition 1 2. 3.
Or 4. In most cases. And you just press 1 or 2 or 3 or whichever partition. You want and you can do more than one 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 we hit d. We select partition 1. We ll just hit w. And hit enter now to write next it out of 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 ext partition. So we will just say and 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 4. We ll hit p. There says partition number will 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. This is really putting one we re going to hit enter the default is one so we ll just hit enter and i ll put in one it s going to ask where you want that to end. So you know if you were going to have more than one partition. I can say plus 10m to make this ten 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 default and just make the partition. The entire size of the drive at this point.
I can hit w. 4. Right so it will write that information because whenever you re doing stuff in in a fdisk. It does not take effect on the drive until you write it so w.
4. Right now we still want to part we have created the partition. But we haven t formatted it yet so let s do mkfs for make file system dot txt. We ll hit tab a few times.
You can see that we have a few options here ext 2 3. Or. 4. Let s just go with 4 in this case and of course.
The partition name so d v s. Excuse. Me sd c. And it s partition 1 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 because i m doing sdc doesn t mean that it s going to be sdc on your device. Because you might have more drives plug in and the order you plug in then 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 will it enter. There oh it says it s mounted so let s unload it real quick.
I don t remember mounting it there we go now i ll do this and of course. We have to sudo that sorry that sorry about that sudo mkfs ext in this case. 4. And my device name all the way down to the partition hit enter a few seconds here.
And it is partitioning perfect. And you can see right here. This will automatically check every 31 months or 180 days for errors. You can override that by using tune.
2 fs. Which is a program. We re going to play with in in tutorials in the next week or so so let me open up my window. Here you can see now i have this ext4 partition here so it worked ext partitions automatically put that folder in there that lost found folder for you.
So. Let s unmount that drive so you mount device. Sdc. 1.
And let s create a fat partition. Lots of times. You re going to want to create at that partition if you re going to want this device to work on multiple operating systems. Fat partitions are in microsoft format.
They re not the best out. There they re kind of outdated. They are very good about being um defrag they get defrag. Very easily.
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 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 formats. So real quick. Here.
Let s go sudo f. Disk. 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 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 f disk. Here. So sudo f.
Disk. And the device will say and for new p for primary. One we ll just use the default and use the hole drive now at this point. We can hit t for tight.
So this is the type of partitions going to be and if we hit l. At this point. We ll give you a list of all possible types that you could use you can see there s a lot i m just going to go with six for fat sixteen. 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 m.
kay fs for make file system dot v. Fat. And the partition name which is device sd c1. And we should do sudo for that as well hit enter and that s it that partition is created let me open up my window over here.
Again and you can see that it s an empty drive. It s a fat32. We could 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 two different formats. So i thank you for watching please visit films by chris comm that s chris with a k. There s a link in the description to 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 ” ..
Thank you for watching all the articles on the topic Creating and Formatting Partitions with FDISK and mkfs – BASH – Linux. All shares of faithandmedia.org are very good. We hope you are satisfied with the article. For any questions, please leave a comment below. Hopefully you guys support our website even more.