The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do I copy files into USB memory stick Schnell SCO 2 11-21-2008 07:29 PM
Can I copy a Unix file to a external memory stick? MarcKim HP-UX 3 11-21-2008 04:28 PM
copy directory structure to a system on the network firefox211 Shell Programming and Scripting 1 10-14-2008 04:55 PM
Copy files to a USB stick SCO 5.07? pschnell SCO 1 07-12-2008 03:55 PM
System copy with flarcreate pasalagua SUN Solaris 2 02-06-2008 10:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-27-2009
jack2 jack2 is offline
Banned
  
 

Join Date: Mar 2009
Posts: 47
How to copy my system hdd usb stick from 4GB to 8GB ?

Hi,

my router is my Linux embedded device.
I have system installed on HDD 4GB usb stick, part1 swap, part2 /opt , part3 data.
I need to copy my system to new HDD 8GB usb stick.
What is a way for 4GB > 4GB HDD
and what for 4GB > 8GB

As I remeber, I can copy image of my 4GB HDD usb stick to a new one
Am I right, I need to format my 8GB HDD usb stick part1 swap, part2 /opt
part3 larger one, or part2 larger too
and I can use move command - mv
to move /opt from HDD 1 to /opt on HDD 2 ?

Please let me know what procedure should I follow,
as my friend lost his HDD stick due worn-out swap partition.

thanks

Jack
  #2 (permalink)  
Old 03-30-2009
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 748
As you have not had a reply yet I will suggest a method (untried!)

1. As you state slice up the new USB stick as per your old one.

2. With Solaris at this point you would run a command to install the boot block into slice 0, for Linux you either go to a desktop system with the same distro in and and select (System -> Administration -> Create a USB startup disk) or you might try this: Free Utility To Make Your USB Pen Drive Bootable | Megaleecher.Net

3. Mount up each slice in turn from your stick and the new one (e.g. to .mount/source and /mount/target).

4. Copy with: find /mount/source | cpio -pdmv /mount/target.

Let the forum know how you get on?

HTH
  #3 (permalink)  
Old 03-31-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,947
Let me see if I understood this right, your layout is something like this (using /dev/sdg for the stick):
  • /dev/sdg1 swap swap
  • /dev/sdg2 ? /opt
  • /dev/sdg3 ? ?
Is the system, as you called it, on /dev/sdg3? Has the device to be bootable?

As a side node, using a flash-drive partition as swap is generally a bad idea, since they only survive about 10000 write cycles.
  #4 (permalink)  
Old 03-31-2009
jack2 jack2 is offline
Banned
  
 

Join Date: Mar 2009
Posts: 47
Quote:
Originally Posted by pludi View Post
Let me see if I understood this right, your layout is something like this (using /dev/sdg for the stick):
  • /dev/sdg1 swap swap
  • /dev/sdg2 ? /opt
  • /dev/sdg3 ? ?
Is the system, as you called it, on /dev/sdg3? Has the device to be bootable?

As a side node, using a flash-drive partition as swap is generally a bad idea, since they only survive about 10000 write cycles.
Exactly the case I need to have spare flash hdd system stick - scsi device.
How long does it for 100000 write cycles to complete ?

I suppose, the device has to be bootable.
Linux firmware is already installed in router's internal flash memory.
hdd flash usb stick as system with
part1 swap
part2 /opt
part3 /tmp data

I can use router if hdd usb flash stick is in and out.
In case it's out, I get standard router's functionality by Asus.
With usb stick in I get access to ipkg packages, installed applications,
root access and more.

As it took me months to install and configure some applications
and recently I native compiled Unix Linux dialog utility with examples running and being tested, I need to keep my Linux environment as safe as possible, keeping spare system usb flash for use in case it is necessary.

thanks

Jack
  #5 (permalink)  
Old 03-31-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,947
Just to get the background right: why would an embedded device need additional software? And user-interactive on top of that? Those devices are usually intended for the cycle of "power on -> setup -> ignore -> scrap", with at little user interaction as possible. If you want a "full" Linux on there, take a look at DD-WRT and it's cousins.

Anyhow, given what you told me, there's nothing essential to the boot process on that stick, so it's a simple partiton, format, cp -a.

As for the flash memory, I remembered wrong by an order of magnitude, it's 100 000 write cycles (linky). I just wanted to warn you since a friend of mine thought it a great idea to keep his swap partition on a flash drive. It didn't even survive first boot.
  #6 (permalink)  
Old 04-01-2009
jack2 jack2 is offline
Banned
  
 

Join Date: Mar 2009
Posts: 47
Quote:
Originally Posted by pludi View Post
Just to get the background right: why would an embedded device need additional software? And user-interactive on top of that? Those devices are usually intended for the cycle of "power on -> setup -> ignore -> scrap", with at little user interaction as possible. If you want a "full" Linux on there, take a look at DD-WRT and it's cousins.

Anyhow, given what you told me, there's nothing essential to the boot process on that stick, so it's a simple partiton, format, cp -a.

As for the flash memory, I remembered wrong by an order of magnitude, it's 100 000 write cycles (linky). I just wanted to warn you since a friend of mine thought it a great idea to keep his swap partition on a flash drive. It didn't even survive first boot.
My dear friend,

I exactly have "full" Linux, cousin of DD-WRT installed.
So stick is made of 3 partitions, already mentioned by me.
For swap partition there is no need to copy anything, just create swap partition and set swap on.

For /opt partition (system files, applications, full Linux) I need to
mirror or clone it on another stick.
Please tell me if copy can preserve symbolic links, already created on
part2, part3 (for data) ?

I run 2 router-servers with full Linux and swap partition is on a stick
and one has been in operation for the last 4 months as 10-man small network router/server and another one is for tests.
I have one another spare router, exactly to replace that one serving small network, in case of problems.

So I need to have it maintained as a mirror copy.
I can transfer firmware, configuration file from router's internal flash nvram memory, as they come as open source Linux.
The issue is usb stick
partitioned to 1, 2, 3

I will try with copy today and will report you my success or failure.

Ok. I was told about problems with a swap partition on usb stick
but this solution was advised to me by project developers and it worked for me.

Asus Eee netbooks come with Linux and SSD memory only,
and I would like to know in what SSD memory so special for swap partition,
as come sticks come already marketed as SSD stick.

In either case I need to learn how to mirror such stick, partitioned to part1, part2, part3.

thanks

Jack
  #7 (permalink)  
Old 04-01-2009
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 748
1.
Quote:
Please tell me if copy can preserve symbolic links, already created on
part2, part3 (for data) ?
2. Using:

Code:
# find /mount/source | cpio -pdmv /mount/target

to copy the partition of one stick to another will preserve symbolic links.

3. The USB stick evidently does not need to be bootable it is simply adding writable storage to the Linux already installed in the router.

4. Using a USB stick for swap on a system that has enough memory such that it does not use swap is okay is it not? This is assuming Linux is like Solaris and does keep a copy of memory in swap all the time but only:
1. Uses swap when the OS is actually low on memory.
2. Swap out a process in memory has not been used for a long time (in which case it will get swapped out but may not need swapping back in if the copy in memory is still resident)?

Last edited by TonyFullerMalv; 04-01-2009 at 05:26 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0