Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-31-2005, 06:48 AM   #1
LQ Newbie
Registered: Dec 2004
Distribution: Ubuntu Desktop 8.10
Posts: 20

Rep: Reputation: 0
Linking a file on disk to a fake block device?


Is it possible to 'attach' a file on the disk (say, an ISO image) to a fake block device (i.e. /dev/cdrom) so that programs that directly access /dev/cdrom or other will instead be redirected to that file? I tried to symlink the file to /dev/cdrom but that didn't work very well. I know there's a command somewhere to create a /dev node, but I think it requires that a 'handler' for that node already be 'registered'...

Any help with this issue would be greatly appreciated! Thanks!
Old 10-31-2005, 07:19 AM   #2
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 249

Rep: Reputation: 30
I too would be interested in this, I was trying to see if I could get GRUB to boot from an ISO image without the need to burn it to CD and one of the things I wanted to try was setting the root= in the bootloader to a block device which pointed to the ISO image to see if that worked.
Old 10-31-2005, 07:23 AM   #3
Senior Member
Registered: Oct 2003
Posts: 2,556

Rep: Reputation: 213Reputation: 213Reputation: 213
You can probably do that using a loop device. For example, you can mount isos with:

# mount /<path to iso> /<mount point> -o loop

and they will read like a burned cd of the iso image file. The device file for loop is /dev/loopx where 'x' is 0 for the first loop device. In the above example you would then create a symlink to /dev/loop0 with:

# ln -s /dev/loop0 /dev/cdrom


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Block device /dev/sda3 is not a valid root device.. rincewind Linux - Hardware 7 06-09-2006 04:47 AM
What is a New Block Device cthomas Linux - Hardware 9 08-19-2005 11:14 AM
How do I block referrers that are linking to my server? needforspeed Linux - Software 1 07-05-2005 08:01 PM
block device name??? franco Debian 2 10-23-2003 05:15 AM
Hard disk now displaying "not a valid block device" when booting in rescue mode alphasure Linux - Hardware 4 06-05-2003 07:49 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:01 PM.

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