LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 10: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, 10: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, 01:06 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Also expand on 'from file'...
 
Old 05-22-2013, 01: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, 09:12 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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


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


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