Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

mount whole HD to folder


  • Please log in to reply
7 replies to this topic

#1 BubikolRamios

BubikolRamios

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:12:27 PM

Posted 13 October 2009 - 08:18 PM

ok was reading this: mount tutor

I have 2 HD-s, each 500 GB

[root@linux ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)


[root@linux ~]# df -a
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
940828396 15205100 877061120 2% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
/dev/sda1 101086 12004 83863 13% /boot
tmpfs 2033888 0 2033888 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs


[root@linux ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 60801 488384001 8e Linux LVM


Well, all I can tell is that I can't tell what m'I looking at. There must be something on one HD(I belive marked (/dev/sda1) otherwise there would be nothing there.
On another forum I was told that OS sees both disks as one disk.

All I need is to have one of those HD-s separately mounted to one folder, how can I do that ?

Edited by BubikolRamios, 13 October 2009 - 08:20 PM.


BC AdBot (Login to Remove)

 


#2 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,259 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:03:27 AM

Posted 13 October 2009 - 09:20 PM

Unix-like systems contain all physical drives within the root filesystem, where they look like directories. Look in the /media or /mnt directory for your drives. If they're mounted, they should be there.

#3 powerjuce

powerjuce

  • Members
  • 321 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:06:27 AM

Posted 13 October 2009 - 10:00 PM

[root@linux ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 60801 488384001 8e Linux LVM

That is the important one.


I am not sure how much you know about linux but I will try and give you a rough overview.

There are no drive letters under Linux. Instead, the root of the file-system, known as C:\ under Windows, is identified simply by a forward
slash (/). Each device is listed as a device in the /dev folder. All drives start with a "sd" or "hd" depending on their type. Yours start with the "sd". To differentiate physical drives are letters denoting the actual physical drives eg. the letters a,b,c. So that makes the first drive in your system "sda". Finally the partition number is added to drive you are looking at. So the first partition on drive "a" would look like (for you at least) "sda1".
Therefore it would be listed as a device as "/dev/sda1". The next physical drive will be listed as "/dev/sdb" and with the partition included it would be listed as "/dev/sdb1". Note that "/dev/sda1" and "/dev/sdb1" are different, they are 2 physical drives. This is different than in Windows, where each partition or drive would be listed as a different drive letter. For example what would be "/dev/sda1" and "/dev/sda2" to linux, would be drives C: and D: to Windows, even though it is the same physical drive. And what is "/dev/sda1" and "/dev/sdb1" to linux would also be drives C: and D: to Windows because they are two different drives. See how it works? With linux there is a distinction between partition and drive. Whereas with Windows there is no such distinction.
Now why did u need all of that?
With that information we can now interpret the results of fdisk -l much better.

/dev/sda1 * 1 13 104391 83 Linux
we know that /dev/sda1 is your first drive and your first partition.

/dev/sda2 14 60801 488279610 8e Linux LVM
we know that /dev/sda1 is your first drive and your second partition.

/dev/sdb1 * 1 60801 488384001 8e Linux LVM
we know that /dev/sda1 is your second drive and your first partition.

That is your second drive.

Now to mount it. This is the simple part. You should first try (do all of this in terminal or console from here on i will use the term BASH)
mount /dev/sdb1
(if your operating system requires sudo go ahead and use it if you need it.)

you will probably get something like
mount: can't find /dev/sdb2 in /etc/fstab or /etc/mtab
This is fine, because all it means is that the system does not know while folder to put this drive in.

Next in your BASH prompt type in:
mkdir /media/sdb2
or
mkdir /mnt/sdb2
(if your operating system requires sudo go ahead and use it if you need it.)
Depending on your operating system its different. If you have a /media folder then put it in there.

Finally type in:
mount /dev/sdb1 /media/sdb2
or
mount /dev/sdb1 /mnt/sdb2
(if your operating system requires sudo go ahead and use it if you need it.)

Finally navigate to to that folder on your drive, and you should see the contents of the drive in that folder.


I suggest you look at this free book: Ubuntu Pocket Reference. It gives a fairly good tutorial of Linux, and while it is focused on Ubuntu, you can learn a lot from it.

hope this helps
~powerjuce

Edit: Added the link to book.

Edited by powerjuce, 13 October 2009 - 10:03 PM.


#4 BubikolRamios

BubikolRamios
  • Topic Starter

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:12:27 PM

Posted 14 October 2009 - 05:33 AM

mount /dev/sdb1 /mnt/sdb2

--> some message that I have to specify file system, so:

[root@linux ~]
mount -t ext3 /dev/sdb1 /mnt/sdb2
mount: /dev/sdb1 already mounted or /mnt/sdb2 busy


now I can without "-t ext3":

[root@linux ~]
mount /dev/sdb1 /mnt/sdb2
mount: /dev/sdb1 already mounted or /mnt/sdb2 busy


I read somewhere I should disable device-mapper , rebot and then this would work.

dm-mod/dm-mirror <-- where is that, if I should touch that at all ?

note: if I look at folder mnt/sdb2 permisions it says for owner : cant wiev & modify content. Is that ok ?

Edited by BubikolRamios, 14 October 2009 - 07:12 AM.


#5 powerjuce

powerjuce

  • Members
  • 321 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:06:27 AM

Posted 14 October 2009 - 06:49 PM

[root@linux ~]
mount /dev/sdb1 /mnt/sdb2
mount: /dev/sdb1 already mounted or /mnt/sdb2 busy

based on that you should be able to go to the /mnt/sdb2 folder and use that

may i ask what distro you are using?

#6 BubikolRamios

BubikolRamios
  • Topic Starter

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:12:27 PM

Posted 14 October 2009 - 11:47 PM

centOS, I can go there and use it, but it is directorry like all others, I mean if that would be it then
/dev/sdb1 should be mentioned down below , right ?

[root@linux ~]# df -a
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
940828396 15221476 877044744 2% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
/dev/sda1 101086 12004 83863 13% /boot
tmpfs 2033888 0 2033888 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs


Edited by BubikolRamios, 14 October 2009 - 11:48 PM.


#7 powerjuce

powerjuce

  • Members
  • 321 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:06:27 AM

Posted 15 October 2009 - 06:06 PM

it may not be mounted, however it will still be visible through that folder
sometimes it is done like that for convenience

#8 BubikolRamios

BubikolRamios
  • Topic Starter

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:12:27 PM

Posted 21 October 2009 - 01:16 AM

ok, done it like this.

link

Thanks for all help.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users