LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2014, 04:04 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,396

Rep: Reputation: 101Reputation: 101
Question A parted question


I am taking the liberty to post this in Newbie as I believe I am overlooking the simple part of the task at hand. I am in the process of partitioning a 4 TB Western Digital drive for my Linux 12.04 server and am running into the "Partition not aligned..." issue. The simple fix seems to be
Code:
sudo parted --align optimal /dev/sdc
and then creating the partition with the mkpart command. However...

I have used fdisk since the days when LARGE hard drives were 40 MB and it would allow me to make a single partition by just pressing <Enter> to default the start and end of the partition to the start and end of they physical disk. parted seems to require me to specify the starting and ending locations for the partition. Unfortunately I do not know these values nor where to find them.

That said, I have a second drive of the same model which (I think) I formatted with Gparted. If I copy the parameters from that drive
Quote:
(parted) print
Model: ATA WDC WD40EZRX-00S (scsi)
Disk /dev/sde: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 4001GB 4001GB ext4
and enter my command to create the partition on the new drive as
Code:
sudo parted  --align optimal /dev/sdc
mkpart primary 1049kB  4001GB
it seems to work OK. Disk Utility does not complain about the partition not being aligned, I can create an ext4 file system and all is well. Except...

I really need to create two partitions on the new drive. One will be 1 TB and the second to include the rest of the drive. So the questions are...

How do I determine the correct starting point for the first partition? How do I determine how much space exists on a brand new raw drive or how much available space remains after one or more partitions have been created?

I have read forward and backward though the parted user's manual and this answer has eluded me. As usual I am probably missing something simple or obvious.

TIA,

Ken
 
Old 07-10-2014, 05:21 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
If you are familiar with fdsik, you could try gdisk or cgdisk for working with GPT paritions, it should be easier than with parted

Last edited by keefaz; 07-10-2014 at 05:23 PM.
 
1 members found this post helpful.
Old 07-10-2014, 06:40 PM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,396

Original Poster
Rep: Reputation: 101Reputation: 101
Thanks keefaz!

gdisk is more like it. Works like a champ and aligns the partitions to the sector boundaries with no fuss nor muss.

Ken

p.s. Of course I forgot to remove the UUID from the old partition from fstab before rebooting and I had to climb behind the server and attach a keyboard to feed the machine an "s" so it would skip the partition which was no longer there
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about fstab, fdisk, and parted? rjo98 Linux - Newbie 8 01-08-2013 02:43 PM
ok..Parted question. matthewa Linux From Scratch 7 04-05-2005 09:59 AM
parted question greg108 Linux - Newbie 2 08-12-2004 12:54 AM
Question about parted abw Linux - General 12 04-19-2004 05:12 AM
parted question lockejr Linux - Software 2 04-30-2003 04:40 PM


All times are GMT -5. The time now is 04:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration