LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /dev/mapper directory (https://www.linuxquestions.org/questions/linux-newbie-8/dev-mapper-directory-362656/)

joshnya 09-12-2005 09:58 AM

/dev/mapper directory
 
When I enter the df -H command I see I have a:

/dev/mapper/VolGroup00-LogVo100 partition of 19GB that is 100% used.

I'm not quite sure what this partition is and when I cd /deb/mapper/ I have 3 files....a control file, a VolGroup00-LogVo100 and a VolGroup00-LogVo101

Can anybody please explain how to make some available space on this partition? Is it safe to kill these 3 files or any of them?

Thanks very much for the help !!!

pats 09-14-2005 07:49 AM

wo wo wo. slow down you don't wanna start deleting these things.

a volume group is essentially a hard drive and a logical volume is a partition but its a bit more than that. i'll give a more in depth description later on if you wanna hear more about LVs a VGs

right if you give a full output of your df -h then it would be more helpful.

it depends on how you've got your volume group all set up as to what this logical volume is for. i might well be your swap partition and if thats the case then sometimes it will report to be at 100% usage but i doubt very much a default install gave you a 19Gig swap partition. if you look to the left ot the /dev/mapper/VolGro.... you'll see where its mounted. this might just say / or something else.

whatever this directory is will be where all the files are that are taking up 100% of the drive. most likely you've filled your drive up somehow unknowingly

just a small word everythign in the /dev directory is a device (well its a pointer to a device) so when at startup /dev/mapper/VolG..... will be mounted on / or /pat or wherever its set to mount.

this might seem quite strange because how can you mount something thats in /dev/mapper... onto / when thats inside it... (hope that makes sense) it does seem like a circular argument until you take into account the /proc file system.

/proc is where the devices really are. have a look arroun (not editing anyhting mind you) and see what you can find in /proc. plenty of info about all your hardware.

ok so now volume groups

you can 2 or more drives together an create a volume group out of them which essentially acts as one drive. not quite like raid but similar and done at a software level. logical volumes are the partitions you get when you carve you volume group up.
not the best explaination ever but hope you get the idea

joshnya 09-14-2005 07:57 AM

Thanks pats !!! Here are the outputs of my system. Is it better to leave the system with LV and VG rather than the traditional /dev/hd## business ??? All this machine is is a file server on the 2nd FAT32 drive. I don't do anything with the primary OS drive.


root@FTP etc]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00 18G 17G 0 100% /
/dev/hdb1 58G 37G 21G 64% /mnt/share
/dev/hda1 99M 13M 82M 13% /boot
none 315M 0 315M 0% /dev/shm
/dev/hdd1 58G 39G 19G 68% /mnt/backup


Here is the fdisk

[root@FTP boot]# fdisk -l

Disk /dev/hda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2434 19446682+ 8e Linux LVM

Disk /dev/hdb: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 7476 60050938+ c W95 FAT32 (LBA)

Disk /dev/hdd: 61.4 GB, 61492838400 bytes
16 heads, 63 sectors/track, 119150 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 1 119150 60051568+ c W95 FAT32 (LBA)

pats 09-14-2005 08:18 AM

well as far as i know you can't convert a drive thats been formatted with volume groups back to plain old /dev/hdXX

just humour me by running du -ch /home and tell me what the total is at the end

then

umount /dev/hdb1
umount /dev/hdd1
du -ch /mnt
and tell me the total for that.

i suspect theres been a load of data dumped where it shouldn't be

how are you sharing this data as a file server??
samba ... nfs..ftp?

a default install of redhat shouldn't be 20 gig so something must have been put onto it somewhere

joshnya 09-14-2005 08:26 AM

#du -ch /home
2M

#du -ch /dev hdb1
26GB

#du -ch /dev hdd1
28GB

#du -ch /mnt
17GB


So this means the /mnt directory is holding all this data.

I do have a backup script that copies new data from hdb --> hdd. Perhaps the script tried to put the backup into the mnt directory instead.

All these drives are Samba shares.


I guess the root of my qutestion is...is it better to leave the sytem as LVG config'ed instead of trying to get it back to the hda "style". Does it matter one way or the other?

pats 09-14-2005 08:49 AM

Quote:

Originally posted by joshnya
#du -ch /home
2M

#du -ch /dev hdb1
26GB

#du -ch /dev hdd1
28GB

#du -ch /mnt
17GB


So this means the /mnt directory is holding all this data.

seems that way

if with hdb and hdd unmounted you do a ls /mnt and see what comes about

you did do these commands in this order didn't you?


umount /dev/hdb1
umount /dev/hdd1
du -ch /mnt

and that gave you the 17Gig after du -ch /mnt ?


Quote:


I do have a backup script that copies new data from hdb --> hdd. Perhaps the script tried to put the backup into the mnt directory instead.

would be a fair assumption. do you mind posting the script?

Quote:


I guess the root of my qutestion is...is it better to leave the sytem as LVG config'ed instead of trying to get it back to the hda "style". Does it matter one way or the other?

leave it as it is. its not gonna cause any harm. its just a different way of doing things

joshnya 09-14-2005 09:46 AM

and that gave you the 17Gig after du -ch /mnt ?




would be a fair assumption. do you mind posting the script?

it's a cronjobs script:

the /mnt/backup is mounted with /dev/hdd1 device.


45 20 * * 1-5 cp -Ru /mnt/share/Share /mnt/backup

would it be better / possible to:

cp -Ru /dev/hdb1 /dev/hdd1 instead?

pats 09-14-2005 10:20 AM

Quote:

Originally posted by joshnya
and that gave you the 17Gig after du -ch /mnt ?




would be a fair assumption. do you mind posting the script?

it's a cronjobs script:

the /mnt/backup is mounted with /dev/hdd1 device.


45 20 * * 1-5 cp -Ru /mnt/share/Share /mnt/backup

would it be better / possible to:

cp -Ru /dev/hdb1 /dev/hdd1 instead?

ok firstly cp -Ru /dev/hdb1 /dev/hdd1 will not be good. they are the linkers to the devices (read my earlier post.) you mount the device in a certain place ie /mnt/backup in order to access it. this is why you can't do cd /dev/hdd1 and see all your files.

right. the cron job looks ok but again can you just do these commands and tell me what you get.

umount /dev/hdb1
umount /dev/hdd1
df -ch /mnt

and also
ls /mnt to see whats there
and
ls /mnt/share
and
ls /mnt/backup

if you've unmounted those 2 drives and theres nothing else mounted in /mnt then it shouldn't contain any data

if you copy the exact output of the above commands then i should be able to help a bit more

joshnya 09-14-2005 10:47 AM

Okay. I figured it out. Thanks for the help Pats. I really appreciate it.

The copy command copied the hdb1 image to the /mnt/backup directory when the /deb/hdd1 was not mounted so it copied files to the primary hard drive instead of the 3rd hard drive.

Thanks again Pats !!

pats 09-14-2005 10:50 AM

thats what i suspected but good on you for working it out

joshnya 09-14-2005 11:12 AM

Would it be safe to assume I could ensure /dev/hdd1 is mounted by adding to my cronjob task by doing this?

45 20 * * 1-5 mount /dev/hdd1 /mnt/backup cp -Ru /mnt/share/Share /mnt/backup

or would I have to add a second line like this to run a few minutes earlier ?

43 20 * * 1-5 mount /dev/hdd1 /mnt/backup
45 20 * * 1-5 cp -Ru /mnt/share/Share /mnt/backup

pats 09-15-2005 03:09 AM

nope you need to add it to your fstab so it mounts at boot

/dev/hde1 /mnt/hde1 vfat users 0 0

something like that


All times are GMT -5. The time now is 10:33 AM.