LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-29-2005, 09:58 AM   #1
Jehuty
LQ Newbie
 
Registered: Apr 2005
Posts: 5

Rep: Reputation: 0
Resizing a loopback image


I want to make a debain hard drive image that will fit onto my 128MB CF card though debain's default install takes up 130MB, I have made a 200MB loopback drive and installed debian using qemu then removed some packadges so that it is down to something like 110MB. Now i would like to put the disk image on my CF card but i can't because the disk is still 200MB big even though it is only using 110MB of it. Is there any way i can rezize the disk wile keeping the partitions and boot secter in tact?

Or can anyone else sujust a distro that is small enougth to fit on a 128MB CF card and isn't a 'live' disto so that it will acutaly remember what IP address i set it when i boot up and stuff like that. Thanks for any help.
 
Old 08-29-2005, 10:07 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
"I want to make a debain hard drive image that will fit onto my 128MB CF card though debain's default install takes up 130MB, I have made a 200MB loopback drive and installed debian using qemu then removed some packadges so that it is down to something like 110MB. Now i would like to put the disk image on my CF card but i can't because the disk is still 200MB big even though it is only using 110MB of it. Is there any way i can rezize the disk wile keeping the partitions and boot secter in tact?"

Create a second loopback image the size that you want. Partition it, format the partitions, and then copy the files from the larger image to the smaller.

------------------------
Steve Stites
 
Old 08-29-2005, 10:14 AM   #3
Jehuty
LQ Newbie
 
Registered: Apr 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I tryed doing that but i had 2 problems, installing grub on a loopback device didn't want to work (though i'm not sure if i was doing it corectly) and cfdisk (what i was trying to use to partition it with) didn't like the image it just said "FATAL ERROR: Cannot get disk size" Thanks for the quick reply.
 
Old 08-29-2005, 10:39 AM   #4
Jehuty
LQ Newbie
 
Registered: Apr 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I managed to partition it by mouting it and using "cfdisk /dev/loop0" and i have copyed the stuff across, I have prorobly been stupid as i have partitioned it differently, here is the output of "fdisk -l" disk.img is my larger image and cf.img is the smaller image:

#fdisk -l disc.img
You must set cylinders.
You can do this from the extra functions menu.

Disk disc.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
disc.img1 * 1 120 963868+ 83 Linux
disc.img2 121 130 80325 5 Extended
disc.img5 121 130 80293+ 82 Linux swap / Solaris
#fdisk -l cf.img
You must set cylinders.
You can do this from the extra functions menu.

Disk cf.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
cf.img1 1 14 112423+ 83 Linux
cf.img2 15 15 8032+ 82 Linux swap / Solaris

Though should that be alright as long as i edit fstab so that it will mount the swap partition from hda2 instead of hda5 if not then what is the Extended partition used for?

As for grub i have tryed it with "qemu -kernel vmlinux -initrd initrd" so that it should just boot the kernel without grub being involved and it gets to pivot_root and says no such file or directory then it thows a kernel pannic i take it that is somehting to do with the partitioning and notthing to do with grub?
 
Old 08-29-2005, 10:41 AM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
"I tryed doing that but i had 2 problems, installing grub on a loopback device didn't want to work (though i'm not sure if i was doing it corectly) and cfdisk (what i was trying to use to partition it with) didn't like the image it just said "FATAL ERROR: Cannot get disk size""

"installing grub on a loopback device didn't want to work"

Use isolinux instead of grub.

"cfdisk (what i was trying to use to partition it with) didn't like the image it just said "FATAL ERROR: Cannot get disk size""

Come to think of it a mounted loopback ISO is a partition. Just format it without partitioning.

"I want to make a debain hard drive image that will fit onto my 128MB CF card"

An alternative way of doing this is to use LifeBoat.

http://users.rcn.com/srstites/LifeBo...home.page.html

---------------------------
Steve Stites
 
Old 08-29-2005, 10:52 AM   #6
Jehuty
LQ Newbie
 
Registered: Apr 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Unfortinaly i think it needs to be partitioned so i can't just use one drive, though i will try that. The lifeboat linux thing is intresting but not what i am realy looking for, i would prefer to use something like debian as it has all the packadges behind it.

Edit: I have tryed to use images without partitioning and that didn't seem to work.

Last edited by Jehuty; 08-29-2005 at 10:58 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How add a loopback DVD iso image to fstab?? carl0ski Linux - General 3 09-02-2011 02:55 PM
PHP image handling/resizing benrose111488 Programming 1 07-07-2005 02:00 AM
Image resizing algorithms R00ts Programming 1 07-05-2004 12:56 PM
How to grub install to a partition on an image file via a loopback Owen LaGarde Linux - Software 2 12-26-2003 09:06 AM
Mount Loopback filesystem on an entire HD image? wartstew Linux - General 0 01-24-2003 07:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:42 PM.

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
Open Source Consulting | Domain Registration