LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Setup free space on /dev/hdc without screwing up /swap (https://www.linuxquestions.org/questions/linux-general-1/setup-free-space-on-dev-hdc-without-screwing-up-swap-3641/)

DavidPhillips 06-23-2001 01:15 PM

Setup free space on /dev/hdc without screwing up /swap
 
I have a 3G HD with only a swap partition on it. How can I set it up and mount it, then move /home from hda to it? /home is in / .


[david@xxxxxxx david]$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda5 7953612 3269872 4279708 44% /
/dev/hda1 54416 7570 44037 15% /boot


[david@xxxxxxxx david]$ df /dev/hdc
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hdc 7953612 3269872 4279708 44%



Command (m for help): p

Disk /dev/hdc: 128 heads, 63 sectors, 787 cylinders
Units = cylinders of 8064 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 82 330592+ 82 Linux swap

Command (m for help): v
5685182 unallocated sectors



thanks again for all the help.

DavidPhillips 06-24-2001 01:32 AM

Ok I said what the heck and did it.
 
Here's how it went.

Reboot

console login root

fdisk /dev/hdc
n
p
1

partition already exists(I expected this)
n
p
2

no problem

t
83
a(don't know about this but what the heck right.)

mkdir /home2

mount /dev/hdc2 /home2

all kinds of errors(No file system, I should know that)

try typing mkext2fs

no such command

look for info on forum
look for info on internet

ahaa mkfs.ext2 /dev/hdc2

tons of errors to many files systems Blaa Blaa Blaa with a hint (partition not updated other file systems were mounted)

reboot

mkfs.ext2 /dev/hdc2

special geek code look like it worked
decided to try the shinny new linuxconf

filesystems/access local drive

add
partition /dev/hdc2
type ext2
mount point /home2
mount

success

open file manager
there she is, Oh Boy 2.7G

:Pengy: :Pengy: :Pengy: :D

DavidPhillips 06-24-2001 02:07 AM

Moving /home from / to new /dev/hdc2
 
Piece of cake right. Here I go, following my nose.

cp /home/ * /home2
rename /home /home3
rename /home2 to /home
ennhh

what the heck, now of have three of them?

maybe edit fstab

change /home2 to /home
get stupid and rename /home3 to /home and delete /home

reboot

what no /home what the heck have I done
mkdir /home

reboot

logon to user

Smoke cigar and chill out everythings fine.

Ready to move /var next time, think I will use the exact same process cause I know it works.

where will all those logs and stuff go while I am moving it?

Maybe I think I should copy it to /var2 and heck I don't know. I've really gotten attached to having /var right where it is.

mcleodnine 06-24-2001 04:17 AM

Partition juggling is an endeavor that should not be undertaken _way_ after bedtime. I, uhhh... kind of lost some, er, log files when moving my /var to it's own partition. Although there was no actual _need_ to delete stuff in the original /var I thought it would be a more thorough approach. Unfortunately I was in the wrong terminal window and deleted the log files from my firewall box. :rolleyes:

DavidPhillips 06-24-2001 10:35 AM

Bummer
 
Well I don't need to move it yet but I am thinking just back it up, copy it to partition, and then mount it with a reboot. Not sure what will happen.

I think it may just remove the files there but they will probably have to be deleted first.

Can someone clear this up.


All times are GMT -5. The time now is 06:01 PM.