How to copy my system hdd usb stick from 4GB to 8GB ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to copy my system hdd usb stick from 4GB to 8GB ?
# 1  
Old 03-27-2009
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  
Old 03-30-2009
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  
Old 03-31-2009
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  
Old 03-31-2009
Quote:
Originally Posted by pludi
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  
Old 03-31-2009
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  
Old 04-01-2009
Quote:
Originally Posted by pludi
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  
Old 04-01-2009
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..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. SCO

How to use USB Stick in UNIXware?

I am trying to use a USB (Pen?) drive on Unixware 7.1.4. The USB stick is in the machine and the machine recognises it when I enter usbprobe as follows: Path - Address Description ----------------------------- +++++++ BUS #2 0 - 1 - HUB "UHCI Root Hub" 1 - 2 - HID "Chicony Wireless Device"... (1 Reply)
Discussion started by: BernP
1 Replies

2. SCO

Mount USB stick

hi Howto mount an USB stick under SCO 5.0.7? BTW ist it possible to mount USB stick in the command line using 'tools' at the Boot: prompt from OpenServer Release 5.0.7 installation CD? (1 Reply)
Discussion started by: ccc
1 Replies

3. Ubuntu

Ubuntu on USB stick?

Hey Guys I have an Ubuntu CD and I was thinking of creating like a bootable hard drive with various OS so that I can just boot OSs with t drive and not require the CDs. I was just wondering is there a way I can do this, like have Ubuntu boot from a USB stick? If yes how is that possible(even if I... (3 Replies)
Discussion started by: rbansal2
3 Replies

4. BSD

Mounting a USB stick in FreeBSD

When mounting a USB stick or pen drive on a FreeBSD machine I always issue the following command: mount -t msdosfs /dev/da0s1 /mnt Something I have always wondered is what the option msdosfs stands for and more importantly, why it is necessary. (7 Replies)
Discussion started by: figaro
7 Replies

5. Filesystems, Disks and Memory

Mount USB stick...

Dummies questions, perfect for this. I cannot mount my idiotic usb stick on Slackware, I input the following on non-graphic mode as root: Mount -t vfat /dev/sdc1/usbstick usbstick is the folder i created for mounting my USB, the file system is FAT, and everytime I input that I get some kind... (2 Replies)
Discussion started by: Dax01
2 Replies

6. SCO

How do I copy files into USB memory stick

SCO Unix ver 5.07 How do I copy files onto an USB memory stick? Is SCO Unix ver 5.07 able to handle USB memory devices? (2 Replies)
Discussion started by: Schnell
2 Replies

7. UNIX for Dummies Questions & Answers

Aix usb stick

I have a P-Series Machine running AIX 5.3, it has a USB Port on the front of the server, can I use a USB Stick on AIX platforms?? if so how..:rolleyes: (2 Replies)
Discussion started by: BEVAN
2 Replies

8. SCO

Copy files to a USB stick SCO 5.07?

SCO 5.07: How do I copy files to a USB memory stick? The stick is formatted as a hd and has an active Unix partition using the hole stick for Unix. How do I get acces to the stick? (1 Reply)
Discussion started by: pschnell
1 Replies
Login or Register to Ask a Question