bugGNU GRUB - Bugs: bug #31148, Grub Loopback Module Does not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #31148: Grub Loopback Module Does not Contain Offset Functionality

Submitted by:  Jakub Sadowski <kaboosh>
Submitted on:  Tue 28 Sep 2010 10:22:34 AM UTC  
 
Category: Disk & PartitionSeverity: Major
Priority: 5 - NormalItem Group: Feature Request
Status: Wont FixPrivacy: Public
Assigned to: NoneOriginator Name: Jakub Sadowski
Open/Closed: ClosedRelease: 
Release: 1.98Reproducibility: Every Time
Planned Release: None

Wed 21 Mar 2012 10:02:33 PM UTC, comment #4:

loopback loop /myfile
root=loop0,msdos1

Vladimir Serbinenko <phcoder>
Project Administrator
Wed 21 Mar 2012 09:47:07 PM UTC, comment #3:

Rationale for this bug to be re-opened:
- There is no equivalent functionality elsewhere in GRUB2. Blocklists can be read to load a file but cannot be accessed with filesystem semantics (i.e. directory listing, file printout with 'cat', etc...).
- Assuming GRUB's filesystem-awareness is intended to allow it to boot any file accessible to the operating system which may have created it and can read it as well. It only makes sense to have the same semantics as supported OSes so if the Linux loopback module can mount an image with an offset (irregardless of the supposed intent or need for it) then GRUB should be able to do this as well just in case the boot files (kernel, initrd, etc...) might be located there.
- This should be relatively easy to implement.

Potential use cases:

1) We have a system with an MBR-style partition table and a partition with a portion of the disk containing a volume (possibly with a bootable operating system, FakeOS with Prey tracking software loaded on it in case thieves steal the machine). Irregardless the machine has an encrypted volume starting at the sector after the aforementioned partition (and continuing to the end of the disk) partition containing a bootable OS. GRUB is booted from a USB stick to load this OS. Adding the encrypted volume to the partition tables is undesirable as it reveals it's existence which may not be desired by the system owner.

2) One has to support a system booting a Linux kernel compiled without partition support from LILO (don't ask how or why but this is the scenario) and changing to the GRUB2 would allow broader boot device support. Doing this without partitions, however, means placing the LVM volume at an offset from the start of the device to make space for GRUB LVM code to be loaded using blocklists. Ideally it would be great if GRUB could load stage2 with LVM drivers from within an LVM-formatted partition or device.

Jakub Sadowski <kaboosh>
Sat 16 Oct 2010 03:21:06 PM UTC, comment #2:

In case of Linux this feature is mostly a hack to compensate the lack of partition handling on loop devices. GRUB has no such problem. So unless someone supplies a valid usecase (feel free to), this additional functionality is useless

Vladimir Serbinenko <phcoder>
Project Administrator
Thu 30 Sep 2010 12:19:42 AM UTC, comment #1:

No additional feature is required. This can already be accomplished using blocklist syntax: http://www.gnu.org/software/grub/manual/grub.html#Block-list-syntax

Also, grub treats loopback devices like any other device in that if the device contains a partition table those partitions can be accessed like any other partition: (loop,msdos1)

For example:

grub> loopback loop /path/to/disk/image
grub> ls
(loop) (loop,msdos2) (loop,msdos1)

Jordan Uggla <jordanu>
Tue 28 Sep 2010 10:22:34 AM UTC, original submission:

The Linux loopback module and tools allow for a loopback device to be created with an offset from a file or device. To reproduce:

In Linux with a sata drive for testing:
dd if=/dev/zero of=/dev/sdX
losetup -o ARBITRARY_OFFSET_LESS_THAN_DISK_SIZE /dev/loopN /dev/sdX
mkfs.FSTYPE /dev/loopN
mkdir /mnt/loop && mount /dev/loopN /mnt/loop && mkdir /mnt/loop/boot
#memtest for testing - if grub can get the blue memtest screen we win!
cp /boot/memtest86-4.00 /mnt/loop/boot
umount /mnt/loop
losetup -d /dev/loopN

.
.
.

[build grub image with file system and loopback modules built in]
reboot
What grub2 commands do we use to access this offset filesystem?

Jakub Sadowski <kaboosh>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phcoder (Posted a comment)
  • -unavailable- added by jordanu (Posted a comment)
  • -unavailable- added by kaboosh (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 16 Oct 2010 03:21:06 PM UTCphcoderStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1