element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
sudo Sergeant
  • Challenges & Projects
  • element14 presents
  • sudo Sergeant
  • More
  • Cancel
sudo Sergeant
Documents sudo Sergeant 05: Partitions & File Systems
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
sudo Sergeant requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Engagement
Author: tariq.ahmad
Date Created: 26 Sep 2017 6:15 PM
Last Updated: 13 Dec 2017 3:24 PM
Views: 222
Likes: 7
Comments: 2
Related
Recommended

sudo Sergeant 05: Partitions & File Systems

element14's The Ben Heck Show

Join the Ben Heck team every week for amazing hacks! Watch them build and mod community-inspired projects using electronics!

Back to The Ben Heck Show homepage

sudo Sergeant
Featured Bonus Content
See All Episodes

 

 

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

Felix goes over disk partitions and file formats.  Working from command line, he shows you how to view the disk partitions that are on your storage device and how to modify the file system that they are formatted in.

 

 

Partitioning a hard drive divides the available space into sections that can be accessed independently. You can allocate an entire drive to a single partition, or use multiple partitions for dual-booting, maintaining swap partition, or to logically separate data such as audio or video files.  The partition table stores the required information.  Felix gives an overview of two types of partition tables, Master Boot Record (MBR) and Globally Unique Identifier Partition Table (GBT). The first 512 Bytes of a storage device is dedicated to the Master Boot Record (MBR). This comes from an older partitioning scheme that is designed to work with the boot process of the bios. During the boot process the bios loads the beginning 512 Bytes of the first valid disk in the bios disk order. The Global Unique Intentifier Partition Table (GPT) is a partitioning scheme that is part of unified extensible firmware interface specification.   It uses globally unique identifiers (GUIDS), UUIDS in the Linux world, to define partitions and partition types.  It is designed to succeed the master boot record partitioning scheme method. GPT is recommended for systems that boot via a UEFI system.

 

Felix uses a Raspberry Pi and a (Tux the Linux Penguin) USB dongle to demonstrate how this works.  He takes Tux and plugs him into the USB.  He utilizes command line to locate where his device comes up in the device tree.  He uses the command lsblk to shows there are no partitions set up and the device comes up as SDA. He points out mmcblk0 which is the device.   He shows you what mounted partitions look like by pointing to mmcblk2, mmcblk7, mmcblk5, mmcblk1, and mmcblk6. He also shows you the device directory which he gets to by typing in ls /dev.

 

The utility for modifying partitions that Felix is going to uses is f disk and pulled from the following command:

 

$ sudo fdisk /dev/sda

 

 

He shows you how you can pull up the menu by typing m or pull up the partition table by typing p. To create a DOS partition table he types in n for new partition.  He then goes over the commands for creating a new partition table for DOS, how to make it the primary table, and how to set the size of the partition. Felix then goes over the steps for creating another partition.  He does another primary partition and prints the partition table again and demonstrates that a second partition has been added. You how to use command “l” to display all the known partition types.  He chooses a Linux partition and uses w2 to write out the partition table. After verifying the partition exists, he goes over formatting the partition. He formats the partition using the mkfs utility:

 

$ sudo mkfs.ext4  /dev/sda1

 

Ext4 is a journalized file system which is pretty much the standard Linux filing system allocation table of writing super clocks and filesystem account information. sudo fdisk –l/dev/sda  Once the partition is formatted he’s then able to make a directory and mount it in the system.

 

Do you have any questions or advice on partitioning storage on the Raspberry Pi?

 

Let us know in the comments below!

  • rpibeginner
  • globally unique identifier partition table
  • gbt
  • gpt
  • mbr
  • masterbootrecord
  • uefi system
  • uuids
  • linux filing system
  • sudosergeant
  • partitioning
  • linux
  • Share
  • History
  • More
  • Cancel
Anonymous
  • Sean_Miller
    Sean_Miller over 4 years ago

    Good job, Mr. Felix.  I appreciate the additional content to the channel as you're the only channel I care to watch weekly.

     

    Since you started the series, I researched Linux origins some more.  As you know, it was just a grad student who got his start on a Vic 20 that ported Unix after AT&T busted up and put it under a GNU license.  Talk about being in the right place at the right time.

     

    At some point, it would be interesting to know how one would write such a kernel from scratch - or how he did it.  Did he use C under a Windows machine to generate the files - or was he on a Unix box like Silicone Graphics at the time?  You and Ben have unveiled the 8 bit revolution pretty well.  This would be a good tangent.

     

    That will be for a later day though after you flesh out the basics.

     

    See ya',

    Sean

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • DAB
    DAB over 4 years ago

    Very good video Felix.

     

    Well done.

     

    DAB

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube