UbuntuThis forum is for the discussion of Ubuntu Linux.
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.
I'm making a persistent USB work-around due to unetbootin and YUMI both sucking really hardcore and not giving me a persistent Live USB. I do not think that I can USB a $HOME dir unless I'm going to root in a tty, right? Because doing something like that might break Unity while I'm in it while in Live, right?
That's why I'm also leaving the alternative: Everything in $HOME is on the USB rather than $HOME itself. So, $HOME stays where it is, but anything that would go in $HOME would go into the USB. $HOME stays a local directory but whatever goes in $HOME would go into like a false $HOME on the USB.
So, /home/it/ would still exist, but when something goes in there, it would actually go into /media/it/47something/root/home/
What I'll be doing is booting up a Live 15.10 Ubuntu, launching setup.sh in gnome-terminal "#bash ./setup.sh", and having the symlinking occur from there. That way, if I do something like hit prt scr, then it takes a snapsot, and when I save to what would look like /home/it/Pictures(?)/screenshots(?)/, then it would actually save in /home/it/47something/root/home/Pictures/screenshots
And I think I would be symlinking them somehow. However, I cannot recall how to symlink this kind of stuff.
I'm having a little trouble understanding what you're after. Are you booting from an Ubuntu installation on the internal hard drive, or from a live USB drive? Where do you want the data stored in $HOME to end up: on the internal hard drive or USB? Are you trying to set up a non-persistent installation that boots from the internal hard drive, but only stores things in $HOME when the user plugs in a USB drive? More to the point, what do you want the user to be able to change, and what do you want to get erased when you reboot?
I'm having a little trouble understanding what you're after.
q: Are you booting from an Ubuntu installation on the internal hard drive, or from a live USB drive?
a: Live USB
q: Where do you want the data stored in $HOME to end up: on the internal hard drive or USB?
a: A different USB drive, such as a 512MB drive
q: Are you trying to set up a non-persistent installation that boots from the internal hard drive, but only stores things in $HOME when the user plugs in a USB drive?
a: No, the Live USB is booting from a 4GB USB drive
q: More to the point, what do you want the user to be able to change,
a: $HOME is now on a separate USB rather than the RAM $HOME (there is a proper name for this, and I don't really recall casper, rw-ram, and all that crazy RAM crap)
---> I understand this might burn out the USB drive due to the amount of writing. At the bare minimum, I want to know how I could pull this off. But I think the more ideal situation would be having stuff NOT like Mozilla (caching ought to have a TON of writing) on the USB ./home and everything else on the USB. If anyone wants to help tackle this issue at the same time, that'd be grrrrrreat!
q: and what do you want to get erased when you reboot?
a: Not the $HOME that would then exist on, say, the 512MB USB drive.
One of the things about this is that I'm not sure symlinking is the answer. That might cause some "tunnelling latency" or whatever a proper term might be for it: It creates a middleman that may slow things down.
First, a 512 MB USB drive is not big enough to store even one screenshot.
Second, your live OS will not remember mount points or symlinks from one boot to the next.
You can install your OS to the 4GB USB drive in the same way you install to a hard drive. That seems to be your best option.
Correction regarding USB drive size: a single image can be expected to take up ~5MB. 512MB is tiny, by today's standards, but it's enough to hold a good number of images, and a whole lot of text files. If you're not doing much more than that, it should be fine...although there's no telling how much space the system stuff in $HOME might take up, eventually, and you can get a 16GB drive for under $10 (USD), if you shop around. :-)
First, let's see if we can write to the second USB drive as $HOME by symlinking it in a live environment. A noteworthy challenge will making sure that all the necessary files to run Unity and whatnot will be in the right place, and don't cause errors.
It's important that you format the second USB drive to ext2, ext3, or ext4, so that it will support Linux permissions. FAT, exFAT, HFS, HFS+, NTFS, etc. won't work for this.
Boot into the live environment, and plug in the USB drive. Then type this into a terminal. Post any errors or other output that seems noteworthy. (Stuff after a "#" is a comment, and should not be typed, but it won't hurt anything if you do type it.)
Code:
sudo blkid
# note the device node--like /dev/sdXY--of your second USB device and its main partition
sudo umount -f /dev/sdXY # replace XY with the appropriate letter and number
sudo mount /dev/sdXY /mnt
sudo cp -vfrp /home /mnt/
sudo mv /home /home.old -vf
sudo ln -s /mnt/home /home
At this point, you should have /home symlinked to the corresponding directory on the second USB drive, which is mounted at /mnt. The original /home has been copied there, with permissions intact...hopefully. Try opening /home/<username> in a file browser and messing around, a bit. Can you create, delete, execute files as normal? If so, you should next try restarting X. If this works, /home has almost certainly been migrated successfully. If not...we still have something to figure out.
To restart X, press CTRL+ALT+F1 to switch to a TTY terminal. In that terminal, type:
Code:
sudo lightdm stop
sudo lightdm start
(This assumes that the version of Ubuntu you're using makes use of the LightDM display manager. If not, you'll have to look around for the correct one and restart its service.)
Does X come up and work properly? If so, great! All that's left is to automate the above with some clever scripting and possibly a live image customization (the latter is a pain, and should be avoided, if possible). If not, post back any error messages you get, including the output of `dmesg` and `cat /var/log/syslog` (and anything else that might seem relevant).
It should be noted that, using the above method, you'll have to re-copy home to the second USB drive every time you boot, possibly erasing stuff you care about. It's not a complete solution, yet.
DaneM is right, of course - 512 MB will hold quite a few documents.
But, Cyberman, you have a 4 GB drive that probably holds nothing more than the live operating system. That means that you have about 2.5 GB space that you can use on that drive, if you create a persistent file or partition. https://help.ubuntu.com/community/LiveCD/Persistence
Yes, as TxLonghorn suggests, that's a much simpler solution. :-) It's only really worth messing with changing $HOME to a separate drive if you want to be able to put different users' home directories on different USB drives.
I think the bigger issue is trying to find a way to accomplish the OP's goals in a way that isn't a total pain in the rear. I've had some issues with persistence, too; but other solutions are going to involve a whole lot of "duct tape". I'm not entirely sure what the best solution is.
The persistence issue is broken. Hey, feel free to tell me if you can get YUMI or unetbootin to install Ubuntu 15.10 with persistence on it.
I don't know about Ubuntu 15.10 specifically, but the trick with unetbootin is to create a small persistent casper-rw file of about 100 MB (ext2). The operation will fail if you try to create a huge casper-rw file.
You create a fat32 partition just big enough for the live Ubuntu, and a second ext2 partition, giving it the Label "casper-rw". The casper-rw file can then be deleted.
I know that sounds like a strange procedure, but that it how it is done. Here is a tutorial using Mint(based on Ubuntu)
Last edited by TxLonghorn; 04-09-2016 at 04:57 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.