Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi
I want to try out different puplets on my hard-drive without having to mess around with setting and preferences for the same packages each time. Also it would be handy to avoid having to use my backup dvd's to put my data back onto the machine after each install.
Does puppy have a /home folder or something that i could put on a separate partition?
I have never used puppy but i would assume that it has fdisk or cfdisk to create an new partition to be /home, again assuming that you have free space on your hard drive to mess around without having to resize an current partition. Although to note use at your own risk, i would recommend doing some homework before rushing into it.
Ok, partitioning is the easy part, for me, the tricky bit is trying to find /home (in Puppy) and move it onto the new partition.
Lol, the opposite way around from normal no doubt although i would guess that if it involves messing around with fstab then others may find that bit tricky too
Err i forgot to mention that i already have an existing Puppy and want to move it's existing /home (if i can find it) onto a new partition
Lol, thanks for your help so far chaps
Regards from
Tom
I was expecting to find that going up a few levels from "My Documents" would get me to the root of the filesystem which would contain /mnt /etc /var /boot /home but /home seems to be missing?
Yes, in every linux distro i have seen so far you should be able to see /home from doing a "cd /". Did you create a partition for /home in the first place?
I really don't think that 'puppy' would create a separate partition to mount 'home' on therefore your 'home is probably on the same partition as the '/'.
You could use the cli to see the directory of choice by 'ls /' to see what is available;
~# mount
/dev/sda5 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda6 on /home type ext3 (rw)
/dev/sda7 on /usr type ext3 (rw)
/dev/sda8 on /var type ext3 (rw)
/dev/sda9 on /tmp type ext3 (rw)
/dev/sda1 on /mnt/winxp type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sdd2 on /media/Linux_Archive type ext3 (rw,nosuid,nodev,uhelper=hal,data=ordered)
If you want to move your '/home' to another device or another partition on the existing device then you will need to prepare the partition or create it. You would first create the partition using 'fdisk' or 'cfdisk'. After you create the partition then you will need to prepare the partition for the filesystem. The mkfs is a front end for creating/formatting/preparing a partition for a filesystem. Type of filesystem can be a personal choice.
Once you have a partition to accept your new/old filesystem data then it's just a matter of copying or moving the files to that partition. Then you must edit your '/etc/fstab' to mount your new partition to the '/' of your current filesystem. As you wish to mount your new 'home' on '/home' then look at;
Code:
/dev/sda6 /home ext3 defaults 1 2
as a sample. This technique is used all the time during system regeneration or expansion.
Hey OneBeck, thanks i think that solves my troubles there. i was beginning to think Puppy was weirdly different but it looks like your commands will help me find out what's going on and then fix it.
Once you modify the /etc/fstab to include your new /home partition, the filesystem you have created will be mounted over the top of the existing /home (this is not something to worry too much about, but you need to do a little forward planning)
First, backup /home:
Code:
tar xvf /home.tar /home
Second, create a temporary mount point for your new partition and mount it:
Code:
mkdir /home2
mount /dev/sda4 /home2
Third, copy the files from /home to /home2:
Code:
cp -pR /home/* /home2
Forth, change the /etc/fstab as per your question.
Fifth, unmount/remount /dev/sda4:
Code:
umount /home2
mount /home
Sixth, test...
When happy, unmount /home and remove the contents from the sub-mounted folder.
UPDATE:
Puppy doesn't use /home (and logs you in as root)
The home area for the root account is /root in this instance.
It doesn't even provide a friendly way of creating new accounts (no /usr/sbin/useradd; no /usr/sbin/groupadd) .... I manually edited the /etc/passwd and /etc/shadow files to create an account, but you can't run the passwd command to change the password, there is no mkpasswd to create an encrypted passwd.
Now don't get me wrong, I like Puppy. It's just that I use it as a "Live Distro", the old rule of thumb "Don't leave yourself logged in as root" is just too ingrained for me to use Puppy as my main distro.
Last edited by Disillusionist; 05-26-2009 at 04:14 PM.
If you keep your old /home directory just as it is, and you mount any other device on top of it (like mount -t ext3 /dev/sda6 /home), then the mounted device will be available at your /home. Your old /home contents remain intact, but are hidden and not accessible as long as the other device is mounted on top of it. Of course make sure that the mounted device really has proper user home directories, otherwise only your root account will work properly.
Thanks both of you there. I don't have anything i want to save in /home at the moment. On sda1 i have the usual 15 folders /boot /mnt /etc /dev and all that but no /home whereas on sda4 i only have a /home (and a "Lost&Found", which is the wastebin i think?). sda1 and sda4 are both ext2
Regarding user accounts, lol, typical - i think i'm going to have to stick with puppy on this machine tho. It's only got 256Mb Ram and even Puppy is quite slow. I've had a look at TinyCore, Dsl and AntiX on this machine but Puppy seemed to be the best one for some odd reason
Anyway, if my first paragraph helps you help me further then great
Thanks and regards from
Tom
Before you can mount a filesystem there needs to be a directory for it to be mounted on. If there is no /home directory, then you need to make one before you mount the filesystem there.
Puppy is not based on another distribution, but is custom built to only contain the components that it needs. This makes for a very small/efficient operating system, but does mean that you are restricted to what the designers considered to be required.
As I stated in my previous post, Puppy logs you on with the root account with root's home directory being /root.
Assuming you have already created the filesystem (and the /etc/fstab entry for /home)
Now you could copy the contents of /root to /home/root and modify the /etc/passwd entry to use the new home:
Code:
if [ ! -d /home ]
then
mkdir /home
mkdir /home/root
else
if [ ! -d /home/root ]
then
mkdir /home/root
fi
fi
cp -pR /root/* /home/root/.
rm /home/root/icewm
rm /home/root/bin
ln -s /usr/share/icewm /home/root/icewm
ln -s /home/root/my-applications/bin /home/root/bin
Ooo, i'm not sure about moving the /root i'm quite happy that staying where it is. Really i was now just wondering what to do to fstab to make it pickup on the empty /home that i have put on sda4 which is an ext2 primary partition. Does this look about right?
Is the "defaults 1 2" something to do with permissions? I think i will worry about creating a non-root user later. It's not my main machine, just an old one i'm trying to get working for a friends sister. Hopefully she just wants emailing and web-surfing because that's kinda what she's saying. I've never tried setting up a separate /home before although Wolvix and Ubuntu seem to make it a lot easier than this worry about fstab. It's about time i got to grips with fstab tho.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.