<PAGE>

                                                                    Exhibit 10.4

                               SIXTH AMENDMENT TO
                           LOAN AND SECURITY AGREEMENT

         THIS SIXTH AMENDMENT TO LOAN AND SECURITY AGREEMENT AND WAIVER (this
"Amendment"), dated as of January 29, 2003, amends and modifies a certain Loan
and Security Agreement dated as of June 28, 2001 as amended by Amendments dated
as of December 20, 2001, March 25, 2002, May 3, 2002, June 27, 2002 and January
29, 2003 (as amended, the "Credit Agreement") by and between PEMSTAR INC. (the
"Borrower") and U.S. BANK NATIONAL ASSOCIATION (the "Lender"). Terms not
otherwise expressly defined herein shall have the meanings set forth in the
Credit Agreement.

         FOR VALUE RECEIVED, the Borrower and the Lender agree as follows:

                 ARTICLE I - AMENDMENTS TO THE CREDIT AGREEMENT

         The Credit Agreement is amended as follows:

         1.1 Current Liabilities. The definition of "Current Liabilities" in
Section 1.1 is amended to read as follows:

                  "`Current Liabilities' means payment obligations resulting
         from past or current transactions that require settlement within the
         ongoing twelve month period, as determined in accordance with GAAP,
         provided, however, that Current Liabilities shall not include payment
         obligations under this Agreement or under the IBM Credit Loan
         Agreement, regardless of the maturity."

         1.2 Financial Covenants. Section 8.11 of the Credit Agreement is
amended to read as follows:

         "Section 8.11.    Financial Covenants.

                  (a) Adjusted Consolidated Tangible Net Worth. At any time,
         permit the Adjusted Consolidated Tangible Net Worth of the Borrower and
         the Subsidiaries to be less than the sum of (i) $120,000,000, plus (ii)
         the principal amount of Subordinated Debt incurred by the Borrower on
         and after June 27, 2002.

                  (b) Leverage Ratio. As of the last day of any calendar month,
         permit the Leverage Ratio to exceed 1.75 to 1.00 at any time.

                  (c) Intentionally Omitted.

                  (d) Current Ratio. As of the last day of any calendar month,
         permit the Current Ratio to be less than 1.75 to 1.00.

                  (e) Capital Expenditures. Make Capital Expenditures during any
         year exceeding, on a consolidated basis for the Borrower and its
         Subsidiaries, (i) $40,000,000 during the fiscal year ending March 31,
         2002, or (ii) $18,000,000 during any other fiscal year.

                  (f) EBITDA. Permit the EBITDA of the Borrower and the
         Subsidiaries to be less than (i) $5,000,000 for the fiscal quarter
         ending March 31, 2003, or (ii) $6,000,000 for any fiscal quarter ending
         after March 31, 2003."

         1.3 Construction. All references in the Credit Agreement to "this
Agreement", "herein" and similar references shall be deemed to refer to the
Credit Agreement as amended by this Amendment. The Loans shall continue to be

<PAGE>

evidenced by the Note and it is acknowledged that the amount of the Note is
greater than the Line of Credit Amount, as amended hereby.

                   ARTICLE II - REPRESENTATIONS AND WARRANTIES

         To induce the Lender to enter into this Amendment and to make and
maintain the Loans under the Credit Agreement as amended hereby, the Borrower
hereby warrants and represents to the Lender that it is duly authorized to
execute and deliver this Amendment, and to perform its obligations under the
Credit Agreement as amended hereby, and that this Amendment constitutes the
legal, valid and binding obligation of the Borrower, enforceable in accordance
with its terms.

                       ARTICLE III - CONDITIONS PRECEDENT

         This Amendment shall become effective on the date first set forth
above, provided, however, that the effectiveness of this Amendment is subject to
the satisfaction of each of the following conditions precedent:

         3.1 Warranties. After giving effect to this Amendment, the
representations and warranties in Article 6 of the Credit Agreement shall be
true and correct as though made on the date hereof, except for changes that are
permitted by the terms of the Credit Agreement. The execution by the Borrower of
this Amendment shall be deemed a representation that the Borrower has complied
with the foregoing condition.

         3.2 Defaults. After giving effect to this Amendment, no Default and no
Event of Default shall have occurred and be continuing under the Credit
Agreement. The execution by the Borrower of this Amendment shall be deemed a
representation that the Borrower has complied with the foregoing condition.

         3.3 Documents and Fee. This Amendment, a letter respecting calculation
of EBITDA by the Lender to the Borrower, and the acknowledgment by the Guarantor
in the form attached hereto shall have been executed and delivered by the
appropriate parties and the Borrower shall have paid a fee of $10,000 to the
Lender.

                              ARTICLE IV - GENERAL

         4.1 Expenses. The Borrower agrees to reimburse the Lender upon demand
for all reasonable expenses (including reasonable attorneys' fees and legal
expenses) incurred by the Lender in the preparation, negotiation and execution
of this Amendment and any other document required to be furnished herewith, and
in enforcing the obligations of the Borrower hereunder, and to pay and save the
Lender harmless from all liability for, any stamp or other taxes which may be
payable with respect to the execution or delivery of this Amendment, which
obligations of the Borrower shall survive any termination of the Credit
Agreement.

         4.2 Counterparts. This Amendment may be executed in as many
counterparts as may be deemed necessary or convenient, and by the different
parties hereto on separate counterparts, each of which, when so executed, shall
be deemed an original but all such counterparts shall constitute but one and the
same instrument.

         4.3 Severability. Any provision of this Amendment which is prohibited
or unenforceable in any jurisdiction shall, as to such jurisdiction, be
ineffective to the extent of such prohibition or unenforceability without
invalidating the remaining portions hereof or affecting the validity or
enforceability of such provisions in any other jurisdiction.

         4.4 Law. This Amendment shall be a contract made under the laws of the
State of Minnesota, which laws shall govern all the rights and duties hereunder.

         4.5 Successors; Enforceability. This Amendment shall be binding upon
the Borrower and the Lender and their respective successors and assigns, and
shall inure to the benefit of the Borrower and the Lender and the successors



                                       2

<PAGE>

and assigns of the Lender. Except as hereby amended, the Credit Agreement shall
remain in full force and effect and is hereby ratified and confirmed in all
respects.

                            (signature page follows)


                                       3

<PAGE>

         IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be
executed at Minneapolis, Minnesota by their respective officers thereunto duly
authorized as of the date first written above.

                                       U.S. BANK NATIONAL ASSOCIATION

                                       By:      /s/ Christopher J. Schaaf
                                          --------------------------------------

                                       Title    Vice President
                                            ------------------------------------


                                       PEMSTAR INC.

                                       By:      /s/ Greg S. Lea
                                          --------------------------------------

                                       Title    CFO
                                            ------------------------------------


                                       4

<PAGE>

                           GUARANTOR'S ACKNOWLEDGMENT

         The undersigned has guaranteed payment and performance of obligations
of PEMSTAR INC. (the "Borrower") to U.S. Bank National Association (the
"Lender") pursuant to the terms of a Guaranty, dated as of June 28, 2001 (the
"Guaranty"), which obligations include without limitation obligations under that
certain Loan and Security Agreement, dated as of June 28, 2001, as thereafter
amended (the "Credit Agreement"). The undersigned acknowledges that its has
received a copy of the proposed Sixth Amendment to the Credit Agreement and
Waiver, to be dated on or about January 29, 2003 (the "Amendment"). The
undersigned agrees and acknowledges that the Amendment shall in no way impair or
limit the right of the Lender under the Guaranty, and confirms that by the
Guaranty, the undersigned continues to guaranty payment and performance of the
obligations of the Borrower to the Lender, including without limitation
obligations under the Credit Agreement as amended pursuant to the Amendment. The
undersigned hereby confirms that the Guaranty remains in full force and effect,
enforceable against the undersigned in accordance with its terms.

                                        TURTLE MOUNTAIN CORPORATION

                                        By:      /s/ Linda Feuss
                                           ------------------------------------
                                        Title    Secretary
                                             ----------------------------------

                                        and

                                        By:      /s/ Robert F. Wilmot
                                           ------------------------------------
                                        Title    Vice President
                                             ----------------------------------


                                       5