Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6047279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:20:00+00:00 2026-05-23T07:20:00+00:00

I use parted in a script. For that reason I need parted to always

  • 0

I use parted in a script. For that reason I need parted to always use the same unit. Otherwise I am not able to do reasonable calculations.

In this example parted mixes KB and GB:

pcsyn-038 user # parted -l
Model: ATA ST9250315AS (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  21,5GB  21,5GB  primary  ext4
 3      21,5GB  248GB   226GB   primary  ext4
 2      248GB   250GB   2147MB  primary  linux-swap(v1)

This does not have any effect on the output:

parted /dev/sda unit MB
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:20:01+00:00Added an answer on May 23, 2026 at 7:20 am

    According to parted(1), unit can be one of:

    • s sectors
    • B bytes,
    • kB, MB, GB, TB,
    • % percentage of device size,
    • cyl cylinders,
    • chs cylinders, heads, sectors, or
    • compact megabytes for input, and a human-friendly form for output.

    e.g:

    $ for hdd in /dev/sd? ; do 
          parted -m $hdd unit MB print; done  |\
      column -s: -t
    BYT;
    /dev/sda  500108MB  scsi      512       512       msdos  ATA WDC WD5002ABYS-0;
    2         0.03MB    60003MB   60003MB   reiserfs  ;
    3         60003MB   60250MB   247MB     ;
    4         60250MB   499858MB  439608MB  ;
    5         60250MB   75253MB   15003MB   ext3      ;
    6         75253MB   200253MB  125000MB  ext3      ;
    7         200253MB  499858MB  299606MB  ;
    1         499858MB  500105MB  247MB     ext2      boot;
    BYT;
    /dev/sdb  500108MB  scsi      512       512       msdos  ATA ST3500418AS;
    2         0.03MB    60003MB   60003MB   reiserfs  ;
    3         60003MB   60250MB   247MB     ext3      ;
    4         60250MB   499858MB  439608MB  ;
    5         60250MB   75253MB   15003MB   ;
    6         75253MB   200253MB  125000MB  ;
    7         200253MB  499858MB  299606MB  ;
    1         499858MB  500105MB  247MB     ext2      boot;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this SP USE [TestDB] GO /****** Object: StoredProcedure [dbo].[sp_test] Script Date: 06/12/2010
I'm trying to use a script that is provided by an E-commerce site that
We use a bit of javascript that overwrites the setTimeout method for IE. This
I use this bit of code to feed some data i have parsed from
use this website a lot but first time posting. My program creates a number
Is there any function that I can use to parse any string to ensure
Question 1 I used to use that line for my PHP parser file for
This is a really strange issue, I am trying to use the Recaptcha on
I have discovered recently that's possible to call anoymous blocks from jdbc like this:
Working in bash under Linux ubuntu 10 here I have Bash script that reads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.