Modify

Opened 8 years ago

Closed 7 years ago

#55 closed enhancement (fixed)

How do I customize the Sali disk partitions when I have more than 3 partitions?

Reported by: Katherine.Nakazono@jpl.nasa.gov Owned by: bas
Priority: major Milestone: SALI 1.6.0
Component: sali Version: 1.5.6
Keywords: Cc:

Description

After much trial and effort I have successfully imaged a workstation using SALI! Thank you!

My question now is how do I customize the partitioning for the disk when I intend to have more than 3 partitions?

Usually /dev/sda4 is the extended partition, but no matter what I do, Sali insists on making /dev/sda3 the extended partition.

This is the line that I have in my sali.master.new script for the partitioning:

partition $DISK0 200:ext3:/boot:/boot 20000:ext3:/:/ 8000:swap::SWAP-sda3 1024:ext3:/usr/vice/cache:/usr/vice/cache 0:ext3:/scratch0:/scratch0

This is what I get when I image the system using SALI (notice that /dev/sda4 is skipped):

[root@wkstn ~]# fdisk -l

Disk /dev/sda: 256.0 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 25 195584 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 25 2456 19530752 83 Linux
/dev/sda3 2456 31131 230331392 f W95 Ext'd (LBA)
/dev/sda5 2457 3429 7812096 83 Linux <--This is swap
/dev/sda6 3429 3554 999559 83 Linux
/dev/sda7 3554 31131 221517824 83 Linux

This is how I want the machine partitioned based on machines I have imaged in the past with systemimager:

[root@wkstn2 ~]# fdisk -l

Disk /dev/sda: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2308 18434587+ 83 Linux
/dev/sda3 2309 3328 8193150 83 Linux <--This is swap
/dev/sda4 3329 36473 266236590 5 Extended
/dev/sda5 3329 3393 522081 83 Linux
/dev/sda6 3394 36473 265714477 83 Linux

Is there a way to customize the partitioning?

Thank you in advance for your reply.

Attachments (2)

initrd.img (25.2 MB) - added by bas 8 years ago.
extended patch
Partition5ErrorMsg.jpg (1014.1 KB) - added by Katherine.Nakazono@jpl.nasa.gov 8 years ago.
Partition /dev/sda5 error message during imaging.

Change History (18)

comment:1 Changed 8 years ago by bas

  • Type changed from defect to enhancement

Katherine,

We just decided for this code to start at /dev/sda3 for msdos schema. We use gpt partition table. That has no limitations with the number of partitions.

Do you use hardcocded paths in /etc/fstab:

  • /dev/sda1

We have switched to use LABEL format. We encountered a lot of problems with hardcoded paths. Sometimes the disk are detected in the wrong order. Here is an example:

LABEL=root      /               xfs     rw              0       1
LABEL=swap      none            swap    sw              0       0
LABEL=boot      /boot           ext2    rw              0       2
LABEL=scratch   /scratch        xfs     rw              0       2

Do you need the exact layout? Else you have to adjust your script and do partitioning/formatting your self with unix commands.

Maybe we can make an option to support it and only make extended partitions on 4

comment:2 Changed 8 years ago by bas

  • Status changed from new to accepted

comment:3 Changed 8 years ago by Katherine.Nakazono@jpl.nasa.gov

Bas,

Thank you for your reply.

Yes we use the LABEL format in our fstab:

LABEL=/                 /                       ext3    defaults        1 1
LABEL=/usr/vice/cache   /usr/vice/cache         ext3    defaults        1 2
LABEL=/scratch0         /scratch0               ext3    defaults        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
LABEL=SWAP-sda3         swap                    swap    defaults        0 0

What is the purpose of skipping the use of /dev/sda4? (What is the purpose of not partitioning sequentially (1,2,3,4,5,...) vs. the current non-sequential (1,2,3,5,6,7,...) way with GPT? )

It would be nice if we could keep the extended partitions on 4.

We are trying to keep a consistent partition schema for our workstations. Since most have been imaged with systemimager, we'd like to have the same layout. We are using Sali because SystemImager BOEL binaries are very out of date and UYOK doesn't work so well with our newest acquisitions.

comment:4 Changed 8 years ago by bas

Katherine,

I can remember that we encountered some problem with it when we started at 4. The fix is easy. I have to test it.

We switch to gpt partition instead of MSDOS for mbr:

gpt has not the limitation of msdos and the hassle with primary/logical/extended partitions schemas. You just make partitions. The "bug" occurs if msdos partition layout is choosen:

FOR gpt parition layout you have to use the following adjustments in your script.

DISK0=/dev/sda
DISKLABEL=gpt
set_disklabel $DISK0 $DISKLABEL
}}}}

Your kernel has to support gpt partitions. 

comment:5 Changed 8 years ago by anonymous

Bas,

It appears that gpt and uefi are supported in rhel6. Based on my searches via google, it appears that using grub 0.97 does not support GPT. https://wiki.ubuntu.com/EFIBootLoaders
Does this sound true that my kernel does not support GPT?

I should have mentioned that I'm using RHEL5.6, 2.6.18-238.1.1.el5 kernel, and grub-0.97-13.5.x86_64.

I CANNOT upgrade at this time to RHEL6.

If the fix is easy as you stated, I'll have to wait for it.

comment:6 follow-up: Changed 8 years ago by anonymous

I just found this link, so I'm going to give it a try and see what happens: http://serverascode.com/2011/08/09/dl160-g6-2tb-partitions.html (even though I don't have a large disk.)

comment:7 in reply to: ↑ 6 Changed 8 years ago by bas

Replying to anonymous:

I just found this link, so I'm going to give it a try and see what happens: http://serverascode.com/2011/08/09/dl160-g6-2tb-partitions.html (even though I don't have a large disk.)

That is the advantage for gpt and you can create a lot of partitions. Good luck

comment:8 Changed 8 years ago by Katherine.Nakazono@jpl.nasa.gov

Hi Bas,

The partitioning using GPT worked beautifully. I have sequential partitioning with the exception that now I can't boot the system. :-(

[root@wkstn ~]# parted -l

Model: ATA SAMSUNG SSD PM83 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  201MB   200MB   ext3         primary
 2      201MB   20.2GB  20.0GB  ext3         primary
 3      20.2GB  28.2GB  8001MB  linux-swap   primary
 4      28.2GB  29.2GB  1023MB  ext3         primary
 5      29.2GB  256GB   227GB   ext3         primary
...

Per this website ( http://www.linuxquestions.org/questions/linux-hardware-18/rhel-5-3-on-bladecenter-with-gpt-disks-750884/ ), it states "RHEL5 won't boot from a GPT partitioned disk. RHEL5 does support GPT but only as a non-booting storage disk. So any disk that you plan to install RHEL5 into will have to be a normal MBR disk."

I had to boot off the Linux rescue CD to view the partitioning scheme. (No problem chrooting.)

How did your test go to see if you could make the extended partition start at /dev/sda4?

comment:9 Changed 8 years ago by anonymous

I did not test it yet. You can upnack the initrd file and edit:

  • cd <extract_dir>/etc/init.d
  • vi functions
  • search for if [ $NUMPARTITIONS -eq 3 ]
  • change 3 to 4
  • next change ---> NUMPARTITIONS=$(( $NUMPARTITIONS + 2 )) to + 1
  • create initrd again
  • test it. If succesful i will apply the patch

comment:10 Changed 8 years ago by Katherine.Nakazono@jpl.nasa.gov

I tried to unpack the initrd.img file that SALI installed (in mysystem for instance) and the file turns out to be a bz2 compressed file ( #file initrd.img initrd.img: bzip2 compressed data, block size = 900k). I uncompressed it, modified /etc/init.d/functions as instructed. When I created the initrd and tried to image with it, I received a kernel panic and the system turned off. :(

Maybe I'm not creating the initrd correctly?

find | cpio -H newc -o > initrd.img
bzip2 -9 initrd.img
mv initrd.img.bz2 initrd.img

comment:11 Changed 8 years ago by bas

The creation of initrd image is in the initrd Makefile. I have just created on for you is attached in this ticket. Is made for sali-1.5.6

Last edited 8 years ago by bas (previous) (diff)

Changed 8 years ago by bas

extended patch

Changed 8 years ago by Katherine.Nakazono@jpl.nasa.gov

Partition /dev/sda5 error message during imaging.

comment:12 Changed 8 years ago by Katherine.Nakazono@jpl.nasa.gov

Hi Bas,

It worked! I do get an error during the imaging:

"Device or resource busy.  This means Linux won't know about any changes to /dev/sda5 until you reboot -- so you shouldn't mount it or use it before booting.  
Error: Failed to add partition 5 (Device or resource busy)"

"Device or resource busy. This means Linux won't know about any changes to /dev/sda5 until you reboot -- so you shouldn't mount it or use it before booting. Error: Failed to add partition 5 (Device or resource busy)"

I'm attaching an screenshot of the error message. https://oss.trac.surfsara.nl/sali/attachment/ticket/55/Partition5ErrorMsg.jpg

Thank you very much for your help!

Sincerely,

Katherine Nakazono

P.S. Would you mind sending us a mailing address for you and Dennis?

comment:13 Changed 8 years ago by bas

Dear Katherine,

That is why we did/do it with leaving a gap in the partitions. Just be sure you can create the partitions and put data in it with sali?. Or is it only available after reboot?

regards

comment:14 Changed 7 years ago by dennis

  • Resolution set to worksforme
  • Status changed from accepted to closed

comment:17 Changed 7 years ago by katherine.d.nakazono@jpl.nasa.gov

  • Resolution worksforme deleted
  • Status changed from closed to reopened
Hello,

Thank you for this reminder.  I should have closed the loop with you.

You were correct.  The partitions beyond 3 were not formatted.  As a
result, no data is rsynced to them.  One needs to manually configure the
remaining partitions.

Thank you for all your help.  We really appreciate it.

Sincerely,

Katherine Nakazono
===============================================================
Opinions expressed herein are my own and do not represent the opinion or
policy of JPL or any other organization or individual.
===============================================================
Katherine Nakazono
katherine.nakazono@jpl.nasa.gov
Systems Administrator                                    Phone: (818)
354-3565
Guidance, Navigation, & Control Section   Fax:  (818) 393-7413
Jet Propulsion Laboratory                              Cell: (818) 653-9351
4800 Oak Grove Drive     M/S 264-820        Pasadena, CA 91109-8001
===============================================================





On 4/18/13 11:16 PM, "SALI" <sali@surfsara.nl> wrote:

>#55: How do I customize the Sali disk partitions when I have more than 3
>partitions?
>----------------------------------------------+------------------------
>  Reporter:  Katherine.Nakazono@jpl.nasa.gov  |      Owner:  bas
>      Type:  enhancement                      |     Status:  closed
>  Priority:  major                            |  Milestone:  SALI 1.6.0
> Component:  sali                             |    Version:  1.5.6
>Resolution:  worksforme                       |   Keywords:
>----------------------------------------------+------------------------
>Changes (by dennis):
>
> * status:  accepted => closed
> * resolution:   => worksforme
>
>
>--
>Ticket URL: <https://oss.trac.surfsara.nl/sali/ticket/55#comment:14>
>SALI <https://oss.trac.surfsara.nl/sali>
>This software is based on SystemImager: a tool to clone a running
>computer system. We developed SALI to make this cloning process more
>reliable and easier.

comment:18 Changed 7 years ago by bas

  • Resolution set to fixed
  • Status changed from reopened to closed

Thanks we close it again ;-)

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.