educratsweb logo


Commands like fdisk, sfdisk and cfdisk are general partitioning tools that can not only display the partition information, but also modify them.

1. fdisk

Fdisk is the most commonly used command to check the partitions on a disk. The fdisk command can display the partitions and details like file system type. However it does not report the size of each partitions.

$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x30093008

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   146801969    73400953+   7  HPFS/NTFS/exFAT
/dev/sda2       146802031   976771071   414984520+   f  W95 Ext'd (LBA)
/dev/sda5       146802033   351614654   102406311    7  HPFS/NTFS/exFAT
/dev/sda6       351614718   556427339   102406311   83  Linux
/dev/sda7       556429312   560427007     1998848   82  Linux swap / Solaris
/dev/sda8       560429056   976771071   208171008   83  Linux

Disk /dev/sdb: 4048 MB, 4048551936 bytes
54 heads, 9 sectors/track, 16270 cylinders, total 7907328 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001135d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     7907327     3952640    b  W95 FAT32

Each device is reported separately with details about size, seconds, id and individual partitions.

2. sfdisk

Sfdisk is another utility with a purpose similar to fdisk, but with more features. It can display the size of each partition in MB.

$ sudo sfdisk -l -uM

Disk /dev/sda: 60801 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sda1   *     0+ 71680- 71681-  73400953+   7  HPFS/NTFS/exFAT
/dev/sda2     71680+ 476938  405259- 414984520+   f  W95 Ext'd (LBA)
/dev/sda3         0      -      0          0    0  Empty
/dev/sda4         0      -      0          0    0  Empty
/dev/sda5     71680+ 171686- 100007- 102406311    7  HPFS/NTFS/exFAT
/dev/sda6     171686+ 271693- 100007- 102406311   83  Linux
/dev/sda7     271694  273645   1952    1998848   82  Linux swap / Solaris
/dev/sda8     273647  476938  203292  208171008   83  Linux

Disk /dev/sdb: 1020 cylinders, 125 heads, 62 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/54/9 (instead of 1020/125/62).
For this listing I'll assume that geometry.
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sdb1   *     1   3860   3860    3952640    b  W95 FAT32
                start: (c,h,s) expected (4,11,6) found (0,32,33)
                end: (c,h,s) expected (1023,53,9) found (492,53,9)
/dev/sdb2         0      -      0          0    0  Empty
/dev/sdb3         0      -      0          0    0  Empty
/dev/sdb4         0      -      0          0    0  Empty

 

3. cfdisk

Cfdisk is a linux partition editor with an interactive user interface based on ncurses. It can be used to list out the existing partitions as well as create or modify them.

Here is an example of how to use cfdisk to list the partitions.

linux cfdisk disk partitions

Cfdisk works with one partition at a time. So if you need to see the details of a particular disk, then pass the device name to cfdisk.

$ sudo cfdisk /dev/sdb

4. parted

Parted is yet another command line utility to list out partitions and modify them if needed.
Here is an example that lists out the partition details.

$ sudo parted -l
Model: ATA ST3500418AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      32.3kB  75.2GB  75.2GB  primary   ntfs            boot
 2      75.2GB  500GB   425GB   extended                  lba
 5      75.2GB  180GB   105GB   logical   ntfs
 6      180GB   285GB   105GB   logical   ext4
 7      285GB   287GB   2047MB  logical   linux-swap(v1)
 8      287GB   500GB   213GB   logical   ext4


Model: Sony Storage Media (scsi)
Disk /dev/sdb: 4049MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  4049MB  4048MB  primary  fat32        boot

5. df

Df is not a partitioning utility, but prints out details about only mounted file systems. The list generated by df even includes file systems that are not real disk partitions.

Here is a simple example

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6        97G   43G   49G  48% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            3.9G  8.0K  3.9G   1% /dev
tmpfs           799M  1.7M  797M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            3.9G   12M  3.9G   1% /run/shm
none            100M   20K  100M   1% /run/user
/dev/sda8       196G  154G   33G  83% /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5        98G   37G   62G  38% /media/4668484A68483B47

Only the file systems that start with a /dev are actual devices or partitions.
Use grep to filter out real hard disk partitions/file systems.

$ df -h | grep ^/dev
/dev/sda6        97G   43G   49G  48% /
/dev/sda8       196G  154G   33G  83% /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5        98G   37G   62G  38% /media/4668484A68483B47

To display only real disk partitions along with partition type, use df like this

$ df -h --output=source,fstype,size,used,avail,pcent,target -x tmpfs -x devtmpfs
Filesystem     Type     Size  Used Avail Use% Mounted on
/dev/sda6      ext4      97G   43G   49G  48% /
/dev/sda8      ext4     196G  154G   33G  83% /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5      fuseblk   98G   37G   62G  38% /media/4668484A68483B47

Note that df shows only the mounted file systems or partitions and not all.

6. pydf

Improved version of df, written in python. Prints out all the hard disk partitions in a easy to read manner.

$ pydf
Filesystem Size Used Avail Use%             Mounted on                                 
/dev/sda6   96G  43G   48G 44.7 [####.....] /                                          
/dev/sda8  195G 153G   32G 78.4 [#######..] /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5   98G  36G   61G 37.1 [###......] /media/4668484A68483B47

Again, pydf is limited to showing only the mounted file systems.

7. lsblk

Lists out all the storage blocks, which includes disk partitions and optical drives. Details include the total size of the partition/block and the mount point if any.
Does not report the used/free disk space on the partitions.

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0    70G  0 part 
├─sda2   8:2    0     1K  0 part 
├─sda5   8:5    0  97.7G  0 part /media/4668484A68483B47
├─sda6   8:6    0  97.7G  0 part /
├─sda7   8:7    0   1.9G  0 part [SWAP]
└─sda8   8:8    0 198.5G  0 part /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
sdb      8:16   1   3.8G  0 disk 
└─sdb1   8:17   1   3.8G  0 part 
sr0     11:0    1  1024M  0 rom

If there is no MOUNTPOINT, then it means that the file system is not yet mounted. For cd/dvd this means that there is no disk.

Lsblk is capbale of displaying more information about each device like the label and model. Check out the man page for more information

8. blkid

Prints the block device (partitions and storage media) attributes like uuid and file system type. Does not report the space on the partitions.

$ sudo blkid
/dev/sda1: UUID="5E38BE8B38BE6227" TYPE="ntfs" 
/dev/sda5: UUID="4668484A68483B47" TYPE="ntfs" 
/dev/sda6: UUID="6fa5a72a-ba26-4588-a103-74bb6b33a763" TYPE="ext4" 
/dev/sda7: UUID="94443023-34a1-4428-8f65-2fb02e571dae" TYPE="swap" 
/dev/sda8: UUID="13f35f59-f023-4d98-b06f-9dfaebefd6c1" TYPE="ext4" 
/dev/sdb1: UUID="08D1-8024" TYPE="vfat"

9. hwinfo

The hwinfo is a general purpose hardware information tool and can be used to print out the disk and partition list. The output however does not print details about each partition like the above commands.

$ hwinfo --block --short
disk:                                                           
  /dev/sda             ST3500418AS
  /dev/sdb             Sony Storage Media
partition:
  /dev/sda1            Partition
  /dev/sda2            Partition
  /dev/sda5            Partition
  /dev/sda6            Partition
  /dev/sda7            Partition
  /dev/sda8            Partition
  /dev/sdb1            Partition
cdrom:
  /dev/sr0             SONY DVD RW DRU-190A

Summary

The output of parted is concise and complete to get an overview of different partitions, file system on them and the total space. Pydf and df are limited to showing only mounted file systems and the same on them.

Fdisk and Sfdisk show a whole lot of information that can take sometime to interpret whereas, Cfdisk is an interactive partitioning tool that display a single device at a time.

educratsweb.com

Posted by: educratsweb.com

I am owner of this website and bharatpages.in . I Love blogging and Enjoy to listening old song. ....
Enjoy this Author Blog/Website visit http://twitter.com/bharatpages

if you have any information regarding Job, Study Material or any other information related to career. you can Post your article on our website. Click here to Register & Share your contents.
For Advertisment or any query email us at educratsweb@gmail.com

RELATED POST
1. 32 Earth Observation Sensors currently in orbit, providing space based information
The Union Minister of State (Independent Charge), Development of North Eastern Region (DoNER), MoS PMO, Personnel, Public Grievances, Pensions, Atomic Energy and Space, DrJitendra Singh said in a written reply in Rajya Sabha today that there are 32 earth observation sensors with advanced capabilities, currently in orbit, providing space based information.Five earth observation satellites and five
2. NTPC allowed to use drones for research and inspection of Thermal Power Projects
Ministry of Civil Aviation (MoCA) and Directorate General of Civil Aviation (DGCA) have granted conditional exemption to National Thermal Power Corporation (NTPC) for the deployment of Remotely Piloted Aircraft System (RPAS) for carrying out research and inspection activities at Vindhyachal Super Thermal Power Station, Madhya Pradesh, Gadarwara Super Thermal Power Plant, Madhya Pradesh, and Sipat Super Thermal Power Project, Chhattisgarh using drones. Shri Amber Dubey, Joint Secretary, Ministry
3. National Super Computing Mission (NSM) is boosting high power computing in the country
India is fast expanding its supercomputer facilities and developing the capacity to manufacture its own supercomputers in the country. The National Super Computing Mission (NSM) is rapidly boosting high power computing in the country through its various phases to meet the increasing computational demands of academia, researchers, MSMEs, and startups in areas like oil exploration, flood prediction as also genomics, and drug discovery. With the infrastructure planned in NSM Phase-I alre
4. Prototype Fast Breeder Reactor (PFBR) likely to bet commissioned in 2022: Dr Jitendra Singh
The Union Minister of State (Independent Charge), Development of North Eastern Region (DoNER), MoS PMO, Personnel, Public Grievances, Pensions, Atomic Energy and Space, Dr Jitendra Singh said in a written reply to Rajya Sabha that Prototype Fast Breeder Reactor (PFBR) being constructed by Bharatiya Nabhikiya Vidyut Nigam Limited (BHAVINI) is expected to get commissioned by October 2022. On completion of commissioning, PFBR will be adding 500 MW of electrical power to the national grid. Presentl
5. Private Sector Participation in Space Sector
Government has created Indian National Space, Promotion &Authorization Centre (INSPACe), under Department of Space to encourage, promote and hand hold the private sector for their participation in Space Sector. Private players will also be able to use ISRO infrastructure through INSPACe.The decision of Government was conveyed to the Members of the scientific community elaborately, and scientific community welcomed the Government decision. The role of New Space India Limited (NSIL) in the po
6. Rajya Sabha passes Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 today
Rajya Sabha passed Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 in New Delhi today. The Indian Institutes of Information Technology Act of 2014 and Indian Institutes of Information Technology (Public-Private Partnership) Act, 2017 are the unique initiatives of the Government of India to impart knowledge in the field of Information Technology to provide solutions to the challenges faced by the country.The Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 wa
7. New Atomic Power Plants
During the last three years and the current year, the Government has accorded administrative approval and financial sanction for construction of twelve (12) nuclear power reactors - ten (10) indigenous 700 MW Pressurized Heavy Water Reactors (PHWRs) to be set up in fleet mode & two (02) units of Light Water Reactors (LWRs) to be set up in cooperation with Russian Federation to enhance nuclear power capacity in the country. The details of these projects are given below:
8. Indian Space Promotion and Authorisation Centre (IN-SPACe) to promote private investment and innovation in the space sector: Dr Jitendra Singh
The Union Minister of State (Independent Charge), Development of North Eastern Region (DoNER), MoS PMO, Personnel, Public Grievances, Pensions, Atomic Energy and Space, Dr Jitendra Singh said in a written reply to Rajya Sabha that the Government has launched the Indian Space Promotion and Authorisation Centre (IN-SPACe) to promote private investment and innovation in the space sector. IN-SPACe will facilitate and support the Private Sector in the following ways: Provide techni
9. Workshop to mark 20 years of Himalayan Chandra Telescope to highlight the science it produced
In the cold, dry desert of Ladakh, 4500 meters above the mean sea level, for two decades, the 2-m diameter optical-infrared Himalayan Chandra Telescope (HCT) at the Indian Astronomical Observatory (IAO) has been scanning the night sky in search of stellar explosions, comets, asteroids, and exo-planets. The telescope remotely operated using a dedicated satellite communication link from the Centre for Research & Education in Science & Technology (CREST), Indian I
10. Get Ready to Learn RPA Blue Prism
We are living in the midst of a digital era. Technology can enable us to  automate  business processes using Artificial Intelligence (AI) and software rather than people, wherever possible. A technology for this purpose is Robotic Process Automation (RPA). RPA can have a transformative impact on organizations by lowering costs, increasing reliability, and executing quickly. It can also let IT
11. Prime Minister Narendra Modi to inaugurate the summit Responsible AI for Social Empowerment 2020 on October 5
Ministry of Electronics and Information Technology (MeitY) and NITI Aayog are organizing a Global Virtual Summit on Artificial Intelligence (AI), RAISE 2020- ‘Responsible AI for Social Empowerment 2020,’ from October 5-9, 2020. The Summit will be inaugurated by Prime Minister Shri Narendra Modi in the august presence ofMinister of Electronics & IT, Communications and Law &Justice, Shri Ravi Shankar Prasad, eminent global AI expert Professor R
12. Raksha Mantri launches Aero India 21 website; Space Booking Opens for Asia Largest Aeroshow
The 13th edition of Aero India-21 will be held at Air Force Station, Yelahanka, Bengaluru, Karnataka from 3rd to 07th February 2021. Raksha Mantri, Shri Rajnath Singh launched the Aero India 2021 website https://aeroindia.gov.in at New Delhi today giving the go ahead for space-booking. Aero India 2021 website will be a contactless
13. The top Python developers in the United States
Python is a Swiss Army Knife for programmers. It is a veteran programming language present in many applications and operating systems. We can find it running on servers, in iOS, Android, Linux, Windows or Mac applications. This is because it has a moderate learning curve and because its philosophy emphasizes offering a readable code syntax. It is a versatile multiplatform and multiparadigm programming language that stands out for its readable and clean code. On
14. Government is implementing several schemes to encourage students/youth of the country towards the field of science and technology: Dr. Harsh Vardhan
It has been a part of Government’s Science and Technology (S&T) policy toencourage the students/youth of the country towards the field of science and technology. The first three key elements of Science, Technology, and Innovation (STI) Policy of 2013 Are: Promoting the spread of scientific temper amongst all sections of society. Enhancing skill for applications of science among the young from all social strata. Making careers in scienc
15. 11 Digital Education Tools For Teachers And Students
The Most Popular Digital Education Tools For Teachers And Learners Hundreds of digital education tools have been created with the purpose of giving autonomy to the student, improving the administration of academic processes, encouraging collaboration, and facilitating communication
16. Education Minister virtually attends Diamond Jubilee Celebration of Commission for Scientific and Technical Terminology
Union Minister of Education Shri Ramesh Pokhriyal ‘Nishank’ virtually attended Diamond Jubilee Celebration of Commission for Scientific and Technical Terminology (Department of Higher Education) as Chief Guest today. Union Minister of State for Education Shri Sanjay Dhotre also attended the event through video conferencing as Guest of Honor. The Commission has done important work in the creation and development of Scientific and Technical Terminology for Hindi and other Indi
17. CSIR-CMERI comes up with High Flow Rate Water Purification Technology for Fluoride and Iron Removal
NEED OF THE TECHNOLOGY: The contamination of fluoride and iron in drinking water is increasing day by day. Iron is the most abundant trace element in human body, responsible for accomplishment of vital biological functions such as gastrointestinal processes and the regulation of body temperature. But when iron level in water is beyond 0.3 ppm (as per WHO guideline), it shows several adverse effects including liver disease, irregular heart rhythm and neuronal disorder etc.
18. Rocket Launching Port
Union Minister of State (Independent Charge), Development of North Eastern Region (DoNER), MoS PMO, Personnel, Public Grievances, Pensions, Atomic Energy and Space, DrJitendra Singh informed about the status of setting up of country’s second space rocket launching port by ISRO in Kulasekarapattinam, located in Tamil Nadu in a written reply in Lok Sabha. As per the request of Department of Space, Government of Tamil Nadu has identified 961.66.90 hectares in Thoothukudi district. Land surve
19. Successful Flight Test of SMART
Supersonic Missile Assisted Release of Torpedo (SMART) has been successfully flight tested today 5th Oct 2020 at 1145 hrs from Wheeler Island off the coast of Odisha. All the mission objectives including missile flight upto the range and altitude, separation of the nose cone, release of Torpedo and deployment of Velocity Reduction Mechanism (VRM) have been met perfectly. The tracking stations (Radars, Electro Optical Systems) along the coast and the telemetry stations including down range ships
20. IPFT developes Bio-Pesticide Formulation for insect control in seed spice crops as safe alternative to chemical pesticides
 The institute of Pesticide Formulation Technology  (IPFT ) under the Department of Chemicals and Petrochemicals ,Ministry of Chemicals and Fertilizers in collaboration with ICAR- National Research Center on Seed Spices (NRCSS), Ajmer, Rajasthan has successfully developed new Aqueous Suspension formulation technology of bio-pesticide based on  entomo-pathogenic fungus Verticillium lecanii.  
21. CSIR-KPIT demonstrates Hydrogen Fuel Cell fitted car
Council of Scientific and Industrial Research (CSIR) and KPIT successfully ran trials of India’s first Hydrogen Fuel Cell (HFC) prototype car running on an indigenously developed fuel cell stack at CSIR-National Chemical Laboratory, Pune. The fuel cell is a low temperature PEM (Proton Exchange Membrane) type Fuel Cell that operates at 65-75 degree centigrade, which is suitable for vehicular applications.
22. Tata Motors Limited to supply 150 Nexon XZ+ electric compact SUVs & Hyundai Motor India Ltd. to supply 100 units of its Kona electric Premium SUVs
Energy Efficiency Services Limited (EESL), a Super Energy Service Company (ESCO) under the administrative control of Ministry of Power, Government of India, will procure 250 electric vehicles from Tata Motors and Hyundai Motor India. The companies were selected through an international competitive bidding process, which was aimed at increased participation. Tata Motors Limited and Hyundai Motor I
23. Department of Science & Technology is having three binational Centres
Presently the Department of Science & Technology, Govt. of India is having three binationalCentres namely Indo-French Centre for Promotional of Advanced Research (IFCPAR)established with France in 1987, Indo-US Science & Technology Forum (IUSSTF) established in2000 with USA and Indo-German Science & Technology Centre (IGSTC) established in 2010under inter-governmental agreements. During last three years, the following new programmes have been launched by these binationalCentres:
24. Indian Astronomers discover one of the farthest Star galaxies in the universe.
As a landmark achievement in Space missions, Indian Astronomers have discovered one of the farthest Star galaxies in the universe.
25. Contour and Mphasis Partner to Accelerate the Digital Transformation of global Trade Finance
Contour and Mphasis Partner to Accelerate the Digital Transformation of global Trade Finance
26 IAV KSCSTE Scientist and Technical Recruitment 2020 Vacancy #Scientist & Research 21 Days Remaining for Apply
Kerala State Council for Science, Technology and Environment (KSCSTE) is an autonomous body under the government of Kerala. Applications on prescribed format are invited for the Recruitment to the Government Job Vacancy posts of Scientist E2, Scientist-C, Technical Officer & Technical Assistant in the Institute of Advanced Virology (IAV), Thonnakal, Thiruvananthapuram (Kerala). ...
27 DRDO Scholarship Scheme for Girls in Aerospace Engg / Aeronautical Engg / Space Engg & Rocketry / Avionics / Aircraft Engg #Scholorship 20 Days Remaining for Apply
GOVT. OF INDIA, MINISTRY OF DEFENCE DEFENCE R&D ORGANIZATION (DRDO) DRDO Scholarship Scheme for Girls in Aerospace Engg / Aeronautical Engg / Space Engg & Rocketry / Avionics / Aircraft Engg Registrations will start from 19th July 2020 15th Aug 2020 onwards ...
28 Educational talent search program, ALLEN academics young talent search program for students | TALLENTEX 2021 #Scholorship 15 Days Remaining for Apply
Educational talent search program, ALLEN academics young talent search program for students | TALLENTEX 2021For student Studying in class 5th, 6th, 7th, 8th, 9th & 10th Stage-1 : Online | Stage-2 : Offline / CBT ...
29 Faculty Vacancy Recruitment at Cochin University of Science & Technology (CUSAT) 2020 #Faculty & Teaching 21 Days Remaining for Apply
Faculty Vacancy Recruitment at Cochin University of Science & Technology (CUSAT) 2020    Online application on prescribed format is invited from suitable candidates for following Faculty Government Jobs Vacancies in various departments of Cochin University of Science & Technology (CUSAT) and its affiliated colleges for the year 2020. (Advertisement No. : D2/136/Notif/2018) SarkariNaukriBlog dot com ...
30 IBPS 9th IX CRP RRB Officer Office-Assistant Recruitment 2020 #Bank 14 Days Remaining for Apply
 IBPS 9th IX CRP RRB Officer Office-Assistant Recruitment 2020 It has been decided by IBPS to reopen the registration window and invite applications for 9th (IXth) online examination (Preliminary and Main) for Group-A Officers and Multipurpose Office-Assistants (Clerical cadre) Posts in the Participating Organisations in continuation to the detailed advertisement dated 01/07/2020. ...
We would love to hear your thoughts, concerns or problems with anything so we can improve our website educratsweb.com ! visit https://forms.gle/jDz4fFqXuvSfQmUC9 and submit your valuable feedback.
Save this page as PDF | Recommend to your Friends

http://educratsweb(dot)com http://educratsweb.com/content.php?id=1536 http://educratsweb.com educratsweb.com educratsweb