LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-02-2012, 07:57 PM   #1
Abscissa256
Member
 
Registered: Aug 2011
Posts: 76

Rep: Reputation: Disabled
dd'ing a usb drive image to a larger usb drive?


I don't know enough about the nature ext2/ext3 to know the answer to this for myself:

I know I can use the "dd" command to create/restore an image of a USB flash drive. But can I safely write the image out to a USB flash drive that's larger than the original? Or is there something in the ext metadata which would then be incorrect and either result in only the original capacity to be accessible, or cause some other form of corruption?
 
Old 01-02-2012, 08:13 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
If you have the USB image saved, there's nothing to stop you from just trying

But to answer your question: it depends on what your image is. Did you image the entire USB drive or did you image a partition?

For instance (full USB drive):
Code:
dd if=/dev/sdc of=my_usb_drive_image.img
or (for a partition):
Code:
dd if=/dev/sdc1 of=my_usb_drive_image.img
If your image is of the full USB drive, you should be able to write the image file to the bigger USB drive and then run gparted. gparted will allow you to resize a partition--letting you use the full space available on the larger USB drive. gparted will also run the necessary commands to update the ext filesystem (like adding more superblocks) to make the extra space usable.

If you have a partition image, it should be similar. But you will need to restore the image to an existing partition. That partition should be the same size as your original. Once restored, then you can use gparted to adjust the size of the partition like above.

I should point out that gparted is just a frontend for various tools. You could perform all the tasks gparted does by hand. But I don't remember the name of the ext program that grows/shrinks a filesystem off-hand.
 
1 members found this post helpful.
Old 01-03-2012, 02:14 AM   #3
Abscissa256
Member
 
Registered: Aug 2011
Posts: 76

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Dark_Helmet View Post
If you have the USB image saved, there's nothing to stop you from just trying
Heh, yea. I guess I was afraid of possibly ending up with it appearing to work but having subtle problems.

Quote:
Originally Posted by Dark_Helmet View Post
But to answer your question:...
Thanks!
 
Old 01-03-2012, 02:44 AM   #4
onedingo
Member
 
Registered: Jan 2006
Location: Pittsburgh, PA, US
Distribution: Arch
Posts: 69

Rep: Reputation: 19
Quote:
Originally Posted by Abscissa256 View Post
But can I safely write the image out to a USB flash drive that's larger than the original?
Could be a problem if you were using GPT partitions as they have a backup header at the last sector of the drive.

Most usb drives are "floppy formated" though and this is only really a concern for real drives.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync-ing Linux and *BSDs to same external USB drive? methodtwo *BSD 3 06-06-2011 12:16 AM
Usb drive, how to locate it, how to move folder from Usb drive to usr directory eeguy02 Linux - Newbie 5 02-28-2010 11:23 PM
Copy Image of System to larger drive villumanati Fedora 3 03-16-2009 09:57 PM
Installing Debian on USB Hard Drive/USB Jump Drive kushalkoolwal Debian 10 02-26-2009 01:46 PM
Creating/restoring drive image on USB drive OneSeventeen Linux - Newbie 9 07-06-2005 05:08 AM


All times are GMT -5. The time now is 11:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration