LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   extra hard drive (https://www.linuxquestions.org/questions/linux-newbie-8/extra-hard-drive-30836/)

finger51 09-20-2002 08:51 PM

extra hard drive
 
Howdie~

I have SuSE 8.0 installed. When I installed this OS there were two identical hard drives. KDiskFree reports /dev/hdi2 as / and /dev/hdk2 as 'data1'

so this tells me hdi2 is my system and hdk2 is data1 (not sure what this means exactly)

when I use Konquerer to navigate around root, I see data1 in the directory tree and when I go into it it has the same root directory structure. I didn't think much of it since I had two 40 gig drives- so I just ignored it.

Well, I'm steadily running out of space and would like to use the second drive. I have noticed that none of the programs I've installed to /home/user show up in data1. So the question is- can I just delete everything in data1 and use it as a storage drive?

Also-

any recommendations for a backup utility? What directories need to be backed up? I used to like using ghost when I was windowing. I know I can use it still but I'm not sure which directories to backup besides /home and /usr?
I used to keep all the system files on one partition, programs on another and a storage partition. I could back up my c:\ to a CDR and just re-image whenever something went wrong. What should I do in the linux world?

thanks

DavidPhillips 09-21-2002 11:19 PM

first you need a place to put whatever is there

It sounds like you are saying it's your / folder, you cannot just delete what's there


look at this

[root@Micro Office]# mount
/dev/hda7 on / type ext3 (rw,noatime)
none on /proc type proc (rw)
devfs on /dev type devfs (rw)
none on /dev/pts type devpts (rw,mode=0620)
none on /dev/shm type tmpfs (rw)
/dev/hda5 on /mnt/windows type ntfs (rw,iocharset=iso8859-1)
/dev/hda1 on /mnt/windows_c type ntfs (rw,iocharset=iso8859-1)
/proc/bus/usb on /proc/bus/usb type usbdevfs (rw,devmode=0664,devgid=43)




see where it says /dev/hda7 is mounted on /

in the first line

this means that / (called the root folder) is on the partition that's /dev/hda7

you need to look at that and see where the partition you want to use is mounted.

you can also look at /etc/fstab

[root@Micro Office]# cat /etc/fstab
/dev/hda7 / ext3 noatime 1 1
none /dev/pts devpts mode=0620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdc /mnt/cdrom auto user,iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0
/dev/fd0 /mnt/floppy auto user,iocharset=iso8859-1,umask=0,sync,exec,codepage=850,user,auto 0 0
/dev/hda5 /mnt/windows_d ntfs iocharset=iso8859-1 0 0
/dev/hda1 /mnt/windows_c ntfs iocharset=iso8859-1 0 0
none /proc proc defaults 0 0
/dev/hda6 swap swap defaults 0 0




It sounds like you have several partitions mounted, probably
/
/usr
/var
/home


you need to decide how you want it split up on the free drive, then you can partition the free drive the way you want, format it, mount it on your system and copy everything over to the proper folders on it.

then you would change /etc/fstab

make any changes needed in the /etc/lilo.conf file and run lilo


I would make sure I had a working boot disk first

then just setup the empty drive for the system the way you want it

then copy files over to it, you don't need to copy /proc/ just have it an empty folder


this is probably not something for a beginner to try

However if you post your fstab file and the output of mount then maybe you could just move a partition or two somewhere without moving everything

also post the output of df
[root@Micro root]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda7 7684844 4275728 3018740 59% /
none 127724 0 127724 0% /dev/shm
/dev/hda5 3076412 1993064 1083348 65% /mnt/windows_d
/dev/hda1 8393928 7385172 1008756 88% /mnt/windows_c

finger51 09-22-2002 12:41 PM

Hey~

thanks for the response.

fstab:

/dev/hdi2 / reiserfs defaults 1 2
/dev/cdrecorder /media/cdrecorder auto ro,noauto,user,exec 0 0
/dev/cdrecorder1 /media/cdrecorder1 auto ro,noauto,user,exec 0 0
/dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0
/dev/hdk2 /data1 auto noauto,user 0 0
devpts /dev/pts devpts defaults 0 0
/dev/fd0 /media/floppy auto noauto,user,sync 0 0
proc /proc proc defaults 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
/dev/hdi1 swap swap pri=42 0 0
172.16.1.104:/home /mnt/stevie-linux nfs defaults 0 0
/dev/hdg /mnt/mp3s ntfs rw,defaults,user 0 0

_____

df:

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hdi2 18961408 17336328 1625080 92% /
shmfs 514560 0 514560 0% /dev/shm
172.16.1.104:/home 8723020 2577720 6145300 30% /mnt/stevie-linux

_____

mount:

/dev/hdi2 on / type reiserfs (rw)
proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
shmfs on /dev/shm type shm (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
172.16.1.104:/home on /mnt/stevie-linux type nfs (rw,addr=172.16.1.104)



_______


So I guess I should have mentioned that I have been using Kdiskfree to mount the 'data1' drive. It does not mount automagically.

the folder data1 appears in my root directory but it shows no contents until I mount the drive. Then it looks like the / directory structure at the time I installed. There are no extra users (I'm using samba) in home, and none of the programs I've installed show up. Here's mount after I mount the hdk2 (data1) :

/dev/hdi2 on / type reiserfs (rw)
proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
shmfs on /dev/shm type shm (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
172.16.1.104:/home on /mnt/stevie-linux type nfs (rw,addr=172.16.1.104)
/dev/hdk2 on /data1 type reiserfs (rw,noexec,nosuid,nodev,user=dfinger)


It now shows up... in the last line. df gives this now:


Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hdi2 18961408 17336376 1625032 92% /
shmfs 514560 0 514560 0% /dev/shm
172.16.1.104:/home 8723020 2577728 6145292 30% /mnt/stevie-linux
/dev/hdk2 18961408 1406092 17555316 8% /data1


So, since the drive does not get mounted at boot, does this mean I can just delete the contents and add a storage folder?

thanks again...

DavidPhillips 09-22-2002 03:59 PM

well your problem seems to me that / is running low

it also looks like all the system folders are in root except /home

you can get a lot of space back in / by making a partition in some free space on an unused drive, formating it, and moving the files over to it. then mount it in a folder under /

If you have a fairly large drive that you want to use I would move /usr over to it like this

I will pretend it's /dev/hdb but it could be anything

make partition we will call hdb1

format it

mke2fs /dev/hdb1
tune2fs -j /dev/hdb1

or use whatever fs you want

mkdir /tempdir

mount /dev/hdb1 /tempdir

mkdir /tempdir/usr


cp -a /usr/* /tempdir/usr



now you need to make sure everything is there before removing it from /usr

umount /dev/hdb1

rm -rf /usr/*

mount /dev/hdb1 /usr/


you should have everything in /usr and everything is good to go

for boot up

add the line to mount /dev/hdb1 on boot in fstab


/dev/hdb1 /usr ext3 defaults 1 1





when you delete all files from /usr it will give the space to /

when you mount /dev/hdb1 in /usr it will have it's free space in /usr and will not use any space in /

all you need to do is have the empty folder /usr in / and mount /dev/hdb1 on it.

DavidPhillips 09-22-2002 04:17 PM

Also, talking about data1

I don't know what that is, it sounds like a backup of somekind or another system that you can boot if you set a different root

I do know that mounting a unix file system tree in /data1 probably serves no purpose other than to be able to acces it. But I'm not sure what you have there.

You could try this and see what it is


chroot /data1


now you are in the other system using it's files and / is actually /data1

when you exit you will be back in /

finger51 09-22-2002 04:48 PM

Howdie~

pt.1
Hey thats some really helpful stuff. Thanks alot for the instructions. It's really nice and sunny out right now though and the dog has his leash in his mouth. so I'll need to give it a try tomorrow. just had a brainstorm -- maybe just unplug the drive... eh. the simple answers are faves. I'll post results

pt.2
as for chroot-

dfinger@stevie1:~> chroot /data1
chroot: cannot change root directory to /data1: Operation not permitted

then I tried it as su-

stevie1:/home/dfinger # chroot /data1
chroot: cannot execute /bin/bash: No such file or directory

wassatabout.

again thanks

finger

DavidPhillips 09-22-2002 05:39 PM

if it was a complete directory tree it would have /bin/bash

so it's not a dir tree, You should look at it and see what it is.

finger51 09-24-2002 08:31 PM

well, I unplugged it and rebooted. all went well so I got brave and just deleted the entire contents. Worked GREAT!

Thanks for the input. I"ve copied all my music (9gigs) to the 'data1' folder and now have lots of room in root.


All times are GMT -5. The time now is 07:55 PM.