LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-14-2013, 09:08 PM   #1
stevetlam
LQ Newbie
 
Registered: May 2013
Posts: 2

Rep: Reputation: Disabled
[HELP] How to create large number of raw devices from file


I want to create about 6000+ raw device from file. Would anybody help? Thank you very much.
 
Old 05-14-2013, 09:39 PM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
Hi,

Please could you explain what you mean with raw devices?

Cheers
 
Old 05-15-2013, 12:06 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Also expand on 'from file'...
 
Old 05-22-2013, 12:32 PM   #4
stevetlam
LQ Newbie
 
Registered: May 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
I want to create about 6000 raw devices, something like:
dd if=/dev/zero of=/rawdev/fdisk1 bs=1M count=125

then do a
losetup /dev/loop1 /rawdev/fdisk1

But I am not sure how to do so.

By the way, linux supports up to 4096 raw devices. Is there any way I can increase this number?

Thank you very much for your help.
 
Old 05-24-2013, 08:12 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
First of all, why you need to create so many devices? What's the background context behind your request? Perhaps there are other options available.

Next, all you need is a loop of some kind to run the same command on each entry in turn. If it's a simple sequence of numbers, I'd personally recommend a c-style for loop. If the sequence is from a file, then use a while+read loop.

As for the last question, I have no idea personally, but I imagine it would probably require modifying and recompiling your kernel in some way.
 
  


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
[SOLVED] Split large .lvm file when column number changes CLD422 Programming 3 03-05-2012 04:51 PM
shell script to create multiple LVM's or raw devices for syabse ganaiwali Linux - Server 3 03-23-2011 02:13 AM
Need to convert a large number of file types from none standard to txt metalme Linux - Newbie 2 09-28-2009 05:46 PM
How to create chunks (blocks) not raw devices in linux ? ytd Linux - Newbie 15 01-27-2009 07:46 AM
How to find which file has a string when large number of files dwynter Linux - Newbie 2 09-10-2008 06:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:48 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