Let me try again, starting anew. I have explicit inplut and explitic output. 
The disk is 1048576000 bytes long (virtual disk via kvm/qemu, which parted 
sees as a drive with 512/512 sectors). I am using parted v3.0. In all cases, 
"parted -s < /tmp/parts >/dev/ttyS0 2>&1" runs silently and seems to do 
nothing.


====Case 1====
In this first case, I am using 'unit B'. /tmp/parts contains:
---------------
unit B
select /dev/hda
mklabel gpt
mkpart boot reiserfs 1048576 210763775
set 1 boot on
name 1 "/boot"
mkpart swap linux-swap 210763776 470810623
set 2 swap on
name 2 swap
mkpart log reiserfs 470810624 1011875839
name 3 "/var/log"
mkpart root reiserfs 1011875840 2096103423
set 4 root on
name 4 "/"
---------------


"parted </tmp/parts >/dev/ttyS0 2>&1" produces:
---------------
GNU Parted 3.0
Using /dev/hda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit B                                                           
(parted) select /dev/hda                                                  
Using /dev/hda
(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/hda will be destroyed and all data on
this disk will be lost. Do you want to continue?
(parted) mkpart boot reiserfs 1048576 210763775                           
Warning: You requested a partition from 1048576B to 210763264B.           
The closest location we can manage is 1048064B to 1048064B.
Is this still acceptable to you?
(parted) set 1 boot on                                                    
(parted) name 1 "/boot"                                                   
(parted) mkpart swap linux-swap 210763776                        
Warning: You requested a partition from 210763776B to 470810112B.         
The closest location we can manage is 2096103424B to 2096103424B.
Is this still acceptable to you?
(parted) set 2 swap on                                                    
parted: invalid token: swap
Flag to Invert? name 2 swap                                               
parted: invalid token: name
Flag to Invert? mkpart log reiserfs 470810624 1011875839                  
parted: invalid token: mkpart
Flag to Invert? name 3 "/var/log"                                         
parted: invalid token: name
Flag to Invert? mkpart root reiserfs 1011875840 2096103423                
parted: invalid token: mkpart
Flag to Invert? set 4 root on                                             
parted: invalid token: set
Flag to Invert? name 4 "/"                                                
parted: invalid token: name
Flag to Invert? quit                                                      
parted: invalid token: quit
(parted)                                                                  
---------------


Problems:
 1. Why does parted become absolutely silent when the -s option is used?
 2. For partition 1, 1048576 is the first byte of its sector. Why won't parted
    use that sector?
 3. 210763776 is the last byte of its sector. Why won't parted use that
    sector?
 4. For partition 2, 210763776 is the first byte of its sector. Why won't
    parted use that sector?
 5. 470810623 is the last byte of its sector. Why won't parted use that
    sector?
 6. Why does parted say it can only create a 1-sector partition in each case?
 7. it appears that 'swap' and 'root' are not valid partition flags. Have I
    read the wrong documentation?
 8. Why does parted start spewing out its prompt when it reaches EOF and
    require 'kill -9' or <CTRL/\> to kill it?
 9. Why does parted print the warning and prompt and then not wait for a
    response?
10. Why does parted insist that it can only place the second partition after
    the last partition I want to create? And how do it know?



====Case 2====
In this second case, I am using 'unit=s'. /tmp/parts contains:
---------------
unit s
select /dev/hda
mklabel gpt
mkpart boot reiserfs 2048 411647
set 1 boot on
name 1 "/boot"
mkpart swap linux-swap 411648 919551
name 2 swap
mkpart log reiserfs 919552 1976319
name 3 "/var/log"
mkpart root reiserfs 1976320 4093951
name 4 "/"
quit
---------------


"parted </tmp/parts >/dev/ttyS0 2>&1" produces:
---------------
GNU Parted 3.0
Using /dev/hda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s                                                           
(parted) select /dev/hda                                                  
Using /dev/hda
(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/hda will be destroyed and all data on
this disk will be lost. Do you want to continue?
(parted) mkpart boot reiserfs 2048 411647                                 
Warning: You requested a partition from 2048s to 411647s.                 
The closest location we can manage is 2047s to 2047s.
Is this still acceptable to you?
(parted) set 1 boot on                                                    
(parted) name 1 "/boot"                                                   
(parted) mkpart swap linux-swap 411648 919551                             
Warning: You requested a partition from 411648s to 919551s.               
The closest location we can manage is 4093952s to 4093952s.
Is this still acceptable to you?
(parted) set 2 swap on                                                    
parted: invalid token: swap
Flag to Invert? name 2 swap                                               
parted: invalid token: name
Flag to Invert? mkpart log reiserfs 919552 1976319                        
parted: invalid token: mkpart
Flag to Invert? name 3 "/var/log"                                         
parted: invalid token: name
Flag to Invert? mkpart root reiserfs 1976320 4093951                      
parted: invalid token: mkpart
Flag to Invert? set 4 root on                                             
parted: invalid token: set
Flag to Invert? name 4 "/"                                                
parted: invalid token: name
Flag to Invert? quit                                                      
parted: invalid token: quit
(parted)
---------------

Problems:
 1. For partition 1, why does parted insist that it can only create a one
    sector partition from 2047 to 2047 before where I asked it to put the
    partition?
 2. For partition 2, why does parted insist that it can only create a one
    sector partition after the last partition I want to create? 
 3. (Questions 1 and 7-10 from the first case remain valid.)



====Case 3====
In this third case, I am using 'unit=MiB'. /tmp/parts contains
---------------
unit MiB
select /dev/hda
mklabel gpt
mkpart boot reiserfs 1 200
set 1 boot on
name 1 "/boot"
mkpart swap linux-swap 201 448
set 2 swap on
name 2 swap
mkpart log reiserfs 449 964
name 3 "/var/log"
mkpart root reiserfs 965 1998
set 4 root on
name 4 "/"
quit
---------------

"parted < /tmp/parts >/dev/ttyS0" produces:
---------------
GNU Parted 3.0
Using /dev/hda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit MiB                                                         
(parted) select /dev/hda                                                  
Using /dev/hda
(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/hda will be destroyed and all data on
this disk will be lost. Do you want to continue?
(parted) mkpart boot reiserfs 1 200                                       
Warning: You requested a partition from 1.00MiB to 200MiB.                
The closest location we can manage is 1.00MiB to 1.00MiB.
Is this still acceptable to you?
(parted) set 1 boot on                                                    
(parted) name 1 "/boot"                                                   
(parted) mkpart swap linux-swap 201 448                                   
Warning: You requested a partition from 201MiB to 448MiB.                 
The closest location we can manage is 1999MiB to 1999MiB.
Is this still acceptable to you?
(parted) set 2 swap on                                                    
parted: invalid token: swap
Flag to Invert? name 2 swap                                               
parted: invalid token: name
Flag to Invert? mkpart log reiserfs 449 964                               
parted: invalid token: mkpart
Flag to Invert? name 3 "/var/log"                                         
parted: invalid token: name
Flag to Invert? mkpart root reiserfs 965 1998                             
parted: invalid token: mkpart
Flag to Invert? set 4 root on                                             
parted: invalid token: set
Flag to Invert? name 4 "/"                                                
parted: invalid token: name
Flag to Invert? quit                                                      
parted: invalid token: quit
(parted)
---------------

Problems:
 1. For partition 1, why does parted insist that it can only create a one
    block partition from 1.00MiB to 1.00MiB?
 2. For partition 2, why does parted insist that it can only create a one
    sector partition after the last partition I want to create? 
 3. (Questions 1 and 7-9 from the first case remain valid.)




N

_______________________________________________
bug-parted mailing list
bug-parted@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to