Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I am trying to use parted in bash script to create partition table using percentage of the total disk space.
I want to use % so do not have to change script for different HDD size.
I get the total disk size this way:
Code:
DEV=/dev/sda
HDDSZ=$( parted -s $DEV unit B print | grep "^Disk $DEV:" | cut -f 3 -d " " | tr -d B )
Then how can i use parted in the script.
Thanks for your quick prompt
Any chance of a little background on your need to do this in the first place? It seems like a pretty weird layout. 1gbfor /boot is a waste for one thing... and why no LVM? Where on earth does 0.31% come from? Why is the extended partition left 89% empty?
It looks like parted scripts can take a % sign anyway, so there's no need to calculate the percentages yourself in the first place.
Chris, Sorry about that.
Well, i know i need to change the layout, this layout was used for many years and given to me, perhaps you can share your idea to the best way as how to manage the size for sda1 to sda8 with respect to their file system.
But my concern is to get the script working first and then the layout can be changed with your suggestions.
i do not wish to use LVM at this time.
i appreciate your help.
Thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.