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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I want fresh install Debian on an external SSD disk. The PC RAM is 3GB and SSD size 30GB. What would be optimal partitioning scheme, and how to put swap on the internal harddisk? I want also to reserve 10 percent for unallocated space (for overprovisioning) when partitioning. How to make this when run Debian installation from DVD?
'Optimal partitioning' is going to vary by user and needs. The simplest thing to do is just create on root partition for the filesystem and make it 27GB which leaves your 10% for whatever. Putting swap on the internal should be doable but not knowing what your partitioning is on the internal there's no way to give specific advice. I would suggest you select the Manual or Expert option in install so you have more control and see what is happening. I haven't installed Debian for some time so don't know what the option is. Probably a Debian user will come along with a more specific recommendation.
Your installer should show the drives/partitions as well as the filesystem type so you will know which are windows and not install over them accidentally. It should be easy to differentiate between the drives as the size will be shown and I expect your internal with windows 7 is larger than 30GB.
I understand that partitioning scheme depends on SSD disk size and what packages will be used. The SSD disk is 30GB and it's intended for Debian Linux, linux applications and tools, not too big. I don't plan use disk to store images, videos or large files.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
With only* 30GB to use I would be tempted to use one big partition and just restore data from backup when it comes to upgrading to a new Debian release. I say that because while it is possible to get Debian's root to fit into a a partition of around 7GB (this EEE PC is currently using 6.5GB of the root drive) it is also possible, as I have done on my desktop, to use 18GB or so for root .
The options of having separate partitions for root and home limits one to 10GB for root and 20GB for home, 20GB for root and 10GB for home or 15GB for both. I would say all are wasteful in some way, hence my recommendation of just the one partition.
For swap you will probably need to resize your Windows partition so it may be an idea to defrag the Windows drive so that it is safer to resize it.
*30GB isn't small per se it's just not large enough that you can afford to waste much space.
I will create one large partition for root. The Swap space will be 2GB. If to setup a dedicated swap-partition on a system internal HDD (Windows), does it require to resize Windows partition? Also, is there a need to have a separate /boot partition on SSD?
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
If you want to put a swap partition on the hard drive you use for Windows then yes you will need to shrink the Windows partition[s] to create a swap partition on that drive. There is very little need to use a separate /boot partition nowadays that I am aware of. Using separate partitions for various directories has tended to be something more for use with servers where separate drives are used or there is a need to ensure that one directory like /var doesn't use all the available space and kill the system (I'm simplifying and I'm sure I will be corrected if I'm generalising wrongly). Having a separate home partition can be useful when first using Linux as if you break things and have to reinstall your home can remain untouched but it can cause issues also so simply having a backup of important date (which everyone ought to have as a matter of course) can be preferable.
You can use swap files. Not as fast, but just as useful. With dd to make them, mkswap to format them, and swapon to mount them.
If you're not doing anything server-ish, you could use just one partition per distro. I tend to have two distros per disc installed normally. Not that I use both, but there's a peace of mind knowing that I could destroy my main distro and still boot a usable linux.
It depends on how you install debian. If you partition and format the filesystem before the install you could make the swap file(s) before or after the actual installation. Swap kicks in when you run low on or out of RAM to allocate to processes, so as long as you have swap before that happens (if that happens), you're okay. Depending on how you use your system and how much RAM is on the system, it could be argued that you don't need swap. But knowing what happens when you do need it and it's not there, it's still a good idea to have swap.
# dd if=/dev/zero of=swapfile.swap bs=1M count=100
(creates a 100MB file)
# mkswap -v1 swapfile.swap
(formats the file to a swap filesystem)
# swapon swapfile.swap
(adds the swapfile.swap to your swap space)
# swapon -s
(lists your swap space to verify success, you can also see swap specs with "free")
# swapoff swapfile.swap
(removes the swapfile.swap from your swap space)
In the case of a partition for swap, you would mkswap the /dev/ of the partition. Although distro installers tend to do that for you. So not really something you need to concern yourself with. Just know that it's an option if you want to know of swap, or do things manually. The # denotes as root, so prefix with sudo if using a distro like ubuntu. Also note that if you go that route you'll need an entry in /etc/fstab to mount the swap file automatically at boot time.
One advantage of swap files is that you can have more than one, and if it ends up that you need the drive space more than all of the swap files you can stop using one or more of those files and free up the drive space. Without having to resize partitions and other things you feel even less comfortable with. It's not all roses though as swap files are slower than dedicated partitions as they are a swap filesystem formated in a file on another filesystem.
Probably TMI, but just know that it's an option. One of many.
In theory. But if you're the type to have hulu, netflix, youtube, and other things open, at the same time, plus 100+ other tabs in a single browser, then no. Or yes, if you run out of ram and you don't have swap, then the linux kernel goes into offensive mode and starts freeing up ram by killing applications other than the linux kernel.
Although these days, apps that know that they are likely to use more than available ram do so with large files in /tmp/, instead of swap providing potentially unlimited RAM via virtual ram (swap). My 2GB desktop rarely crests 1.5GB of ram usage, but I'm RAM aware. And up until recently only had 1GB of ram on this machine. You don't need it, until you need it.