LinuxQuestions.org
Latest LQ Deal: Linux Power User 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 06-20-2009, 02:29 PM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Can I make symlink to /dev/sdb, and if so, how?


OK, I need a way to tell a script to look in /dev/sdb
but the script is in /home/bz/Documents
so, can I put a symlink /dev/sdb in Documents?
Or, how would I tell the script to go UP folders, instead of down?
thanks
 
Old 06-20-2009, 02:38 PM   #2
NeddySeagoon
Gentoo support team
 
Registered: May 2009
Location: 56N 3W
Distribution: Gentoo
Posts: 178

Rep: Reputation: 40
linus72,

You can use ../ to go to the parent folder and ../../ the grandparent and so on.
 
Old 06-20-2009, 03:16 PM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Ahh...you are a Jedi!

OK, so if I was hanging out in /home/bz/Documents, and my script is there too; But sdb
is in /dev/sdb, then it would be ../dev/sdb or what?
'Cause it's gotta go up to /, then down into /dev/sdb. right?
I'm confused...lol

I'm in /home/bz/Documents and gotta get the script to squirrel up into /dev/sdb
Just clarifying.
Thanks
 
Old 06-20-2009, 04:50 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
The path in the symlink can either be an absolute path or a relative one. If it's a relative path, then it is relative to the directory in which the link is located, i.e. you would want ../../../dev/sdb (as ../dev/sdb would point to /home/bz/Documents/../dev/sdb/ which is /home/bz/dev/sdb).

To create a symlink with an absolute path, you can use:
Code:
cd /home/bz/Documents/; ln -s /dev/sdb filename
To create one with a relative path, you need to omit the leading slash in the target path:
Code:
cd /home/bz/Documents/; ln -s ../../../dev/sdb filename
Hope that helps,

—Robert J Lee
 
Old 06-20-2009, 05:00 PM   #5
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
OK, but there is no filename after /dev/sdb
I am using a script so that when I run portable-qemu I have access to my real usb
it works, but only if I am in /, and the script/qemu folder is in / also.
Qemu must mount a real drive as hdx/sdx not by partition.
it is experimental, yet works.

note, I am not talking about qemu installed in your system, but my portable-qemu,
which is a adaptation of dsl-embedded/billix/qemu-puppy
it runs on Dindows and Linux thru scripts .bat and .sh

i usuually work in /home/bz/Documents or in Desktop so that's why I want the script
to find /dev/whatever or whatever else

I also want to figure how to run the script from usb and be able to have access to
the hd, which is probably simple too.

any help appreciated
thanks
 
Old 06-21-2009, 12:38 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Perhaps you can post the script, so we can see what you mean?
 
Old 06-21-2009, 04:54 AM   #7
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
It sounds like your script in opening dev/sdb rather than /dev/sdb. You can probably make it work just by symlinking the /dev directory itself:

Code:
ln -s /dev/ /home/bz/Documents/dev
 
Old 06-21-2009, 06:38 AM   #8
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
here is script; and I am running from /home/bz

Code:
 qemu/qemu -L qemu/ -no-kqemu -soundhw all -localtime -m 325 -hda qemu/browserpuppy47 -hdb dev/sdb &
so, how do I tell it to go find dev/sdb?
I tried ../ and ../../ to no effect
 
Old 06-21-2009, 06:49 AM   #9
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
dev/sdb &
shouldn't that be
/dev/sdb ?
 
Old 06-21-2009, 06:58 AM   #10
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Yeah, I left the slash out, sorry, that ( /dev/sdb ) works from /, so, now how do I get it to work from
/home/bz?

It's cool, having rw access to real hd/usb in virtuality
I haven't actually tried to move or copy anything to/fro yet

So, Repo, what should I do?
 
Old 06-21-2009, 07:11 AM   #11
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Did you used the suggestion from rjlee ?
 
Old 06-21-2009, 07:20 AM   #12
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
OK, I'm gonna try it Repo.
But, can data be transferred thru a symlink?

And, if so, can I symlink to usb while running the portable qemu from usb?
thanks
 
Old 06-21-2009, 07:28 AM   #13
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
OK, I did that and got a folder named dev with a link, and there's a padlock icon on it.
Should I Chown it or what?
 
Old 06-21-2009, 07:51 AM   #14
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Holy s*** that works good!

i have tinycore on ext3 usb, and booted off a tinycore iso I made which has minimal apps so it runs in qemu faster.
ok, so on usb I have alot of tinycore apps.
So, when I booted portable-qemu, running tc 2.0, it started
restoring the apps from the USB!

on the cd I did'nt specify where to find the apps, so it auto searches, like dsl, and found the tce folder on symlinked usb instead of the minimal apps on cd!

wow, that's cool. so now I have access to a hd/usb/cdrom, etc from portable qemu, wihout ever having to reboot pc, snd it works on Dindows and Linux too.

A potent hacking tool in the wrong hands ay?

note that hda is a unformatted unpartitioned qemu-img
see screenshot

Last edited by linus72; 07-15-2009 at 11:07 AM.
 
Old 06-21-2009, 08:02 AM   #15
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
OH, here's script .sh

Code:
#!/bin/sh
# $Id: invoke Portable-Qemu, boots Portable-Linux (Some)
#  playing on Qemu root Exp root $
# -------------------------------------------------------------------------
# Purpose:
#   To have the ability to play Portable-Linux on Portable-Qemu
#   From USB, within another Virtual system, and/or out
#   of the folder on your Desktop, on Windows(.bat) or Linux(.sh)!
# Author:
#   $%& <thepenandpaper@gmail.com> 06/19/09
# -------------------------------------------------------------------------

 qemu/qemu -L qemu/ qemu/kvm -no-kqemu -soundhw all -localtime -m 350 -boot d -cdrom grub2.iso -hda qemu/HDA -hdb dev/dev/sdb &
yee...I'll be a Master Jedi in a year or two

Last edited by linus72; 06-21-2009 at 08:05 AM.
 
  


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
device order (dev/sdb,dev/sdd) changes why ? comtmr Linux - Enterprise 5 06-26-2012 05:28 AM
iscsi: which local device (/dev/sda, /dev/sdb) is used WITHOUT dmesg? knikkerr Linux - Software 3 08-13-2010 05:30 AM
/dev/sda & /dev/sdb keeps swapping name sinister1 Linux - Hardware 4 02-18-2008 02:44 AM
RHEL4U5 install changes /dev/sda to /dev/sdb bhoch Red Hat 8 12-05-2007 07:33 AM
forcing the order of /dev/sda /dev/sdb etc.. jdaniel Linux - Software 5 05-23-2006 08:41 AM


All times are GMT -5. The time now is 12:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration