Commands not to run on Linux?

Soldato
Joined
7 Jul 2009
Posts
16,234
Location
Newcastle/Aberdeen
Well i've got the few upgrades i was waiting for, but i can't seem to find the motivation to ditch my Mint 11 install for Arch (again). What commands should i run to completely **** up Mint so i have to switch to Arch? ;)

Also, could somebody help me with creating Arch partitions in gParted? I skimmed through the wiki but it's not much clearer - what do i need and what is stored where? It talks about /boot, /var, /home and /usr but i thought you could only have four primary partitions, and that leaves nothing for some swap. And i'm thinking about trying a few different filesystems (other than EXT), maybe ReiserFS for /var and JFS/XFS for... i don't know really. Where would native programs and Wine programs (and AUR programs) be stored ?

Cheers :)
 
Last edited:
A little ;)

I'm kinda waiting on an answer to the second part of the OP though, not much point in destroying this installation before i know how to partition how i want it. All the other times i've installed Arch i've just let the installer do whatever it wanted :p
 
A little ;)

I'm kinda waiting on an answer to the second part of the OP though, not much point in destroying this installation before i know how to partition how i want it. All the other times i've installed Arch i've just let the installer do whatever it wanted :p

You don't really have to do that much. The partitions I create are as follows, unless I'm using a SSD:

Code:
/boot        Ext2        50MB
swap         swap        2GB
/            Ext4        100GB
/home        Ext4        Remaining free space

The latter two are logical partitions, although I forget the exact reason I went down that route. I used to use a separate partition for /var but eventually stopped as I saw now benefit to it, so now it just stays on the same physical partition as / is. For further information, the Beginners' Guide here should give you an idea.

Of course, there are some valid reasons for having more partitions (see here) but I've never personally had a requirement for them in day-to-day usage of Linux. YMMV, naturally. When it comes to filesystems, I've only used Ext3/4, JFS and ReiserFS for / and /home. I didn't notice much difference between Ext4 and JFS at all, but ReiserFS was handy for being able to resize partitions whilst online. Unless you can find any specific reason for selecting a particular filesystem (or you want to be adventurous and try Btrfs) then you'll probably be fine with Ext4 to be honest. :)
 
Scared much ? :D

All these commands do is to null the boot header and first few blocks of all your drives and partitions. Just make sure you don't have any usb sticks attached :D
Earlier in the year when I had an Arch install I was tinkering around, trying to upgrade to Grub 2 using the instructions on the Arch Wiki. Only I mistyped the command to dd zero the existing bootloader such that it overwrote the partition table too - I was doing this live from the system that I was trying to modify (as opposed to using a LiveCD or secondary install). A few expletives later I got a grip and realised all was not lost - I was able to poke around /proc/ and find all the disk geometry information that I needed to manually reconstruct the partition table before rebooting - luckily there were no power cuts in the half hour it took me to figure it out. It's examples like this that leave you thinking 'hey, Linux is pretty neat'.

And because nobody's offered this one yet:
Code:
sudo dd if=/dev/urandom of/dev/mem
(probably won't be fatal but may leave things in a mess and is a fun one to try)
 
@JHeaton: Hmm, okay - that makes it clearer. So what's actually stored in / and what's stored in /home? Because i think the vast majority of the space i take up will be programs; native, AUR and Wine. Are they all stored in the same place? I seem to remember AUR stuff being done in ~/...
 
@JHeaton: Hmm, okay - that makes it clearer. So what's actually stored in / and what's stored in /home? Because i think the vast majority of the space i take up will be programs; native, AUR and Wine. Are they all stored in the same place? I seem to remember AUR stuff being done in ~/...

Everything is under / regardless of whether or not it's on the same partition. You can move certain parts of the filesystem (/home, /usr, /var etc.) to another partition for various reasons, but in terms of directory structure they're still listed under /.

Code:
joel [~]
> ls /
bin   dev  home  lib32  lost+found  mnt  proc  run   srv  tmp  var
boot  etc  lib   lib64  media       opt  root  sbin  sys  usr

If you opt to leave everything (or at least everything other than /boot and /home) under /, then all of your apps, logs and config files will be stored on that partition. If you have a separate /usr, the majority of the software you will install will be placed on that physical partition, rather than the one the rest of / is on. A big advantage of having a separate partition for /home is that you can reinstall the operating system without having to format the partition that contains /home and thus, your files will remain intact, although you will of course have to be wary of any config files located in /home/user that might cause issues later on.

Packages from AUR will be installed to different locations depending on what they are. If you actually look at the contents of a PKGBUILD, you'll see where that particular package is being installed to (and there are cases where you may want to override this, such as having two versions of the same application installed - you can install one version to /opt, which is not typically part of your PATH). Here are a couple of examples of PKGBUILDs that build and install packages to different directories:

https://aur.archlinux.org/packages/ba/basenji/PKGBUILD
https://aur.archlinux.org/packages/co/cobra/PKGBUILD

The first one is just a standard installation to /usr (binary files will be placed in /usr/bin, shared resources in /usr/share, library files in /usr/lib and so on). The second installs to /opt and sets up its own directory structure in there, but places a symbolic link in /usr/bin so that you can run it just by typing cobra rather than the full path to the executable file. But despite the different locations packages can be installed, if you leave the majority of the filesystem structure on the physical partition for /, then that's the only place you have to worry about space for all your software.

If you want a better understanding of what each part of the filesystem hierarchy is for, then I recommend having a look through this as it is full of information. :)
 
Hmm, okay - so packages and AUR stuff will go in /, and from what i can tell Wine programs go into a hidden folder in /home? I can make that work... so if i just 'copy' you and do something like (160ishGB HDD):

Code:
[B]Mt. Pt.        FS        Size[/B]
/boot        Ext2        64MB
swap         swap        2.2GB
/            Ext4        60GB
/home        Ext4        Remaining free space

I should probably be fine. Okay, wish me luck :D
 
Well, i get into gParted and realise that i still don't know the answer to a problem i've had since i first used it. Align to cylinder or MiB? What does that even mean? I read somewhere that cylinder is a better bet, but whenever i select it then go back and check it it shows as MiB. Advice?
 
Well cfdisk looked a lot less confusing than i remember, but when i couldn't find the hex code for EXT2 or 4 i remembered that that's almost exactly what the auto setup does anyway, so i just went through that and changed the sizes. Anyway, i have a usable Gnome 3 desktop up and running now, with flash and sound. Not bad for one night's work, i think we'll have a good week's worth of tweaking now though ;)

Thanks for your help :)
 
Code:
sudo dd if=/dev/urandom of/dev/mem
(probably won't be fatal but may leave things in a mess and is a fun one to try)

That's quite funny. Google tells me /dev/mem holds an image of your ram. The terminal dutifully told me writing to /dev/mem is not allowed, but the system then crashed pretty spectacularly. It wrote about a MB before cancelling dd.

ls -la /dev/mem
crw-r----- 1 root kmem 1, 1 Dec 12 03:23 mem

The first character, which I think is usually file type, is "c". What does this refer to?
 
The first character, which I think is usually file type, is "c". What does this refer to?

It's a "character special file" apparently. From Wikipedia:

Character special files or character devices relate to devices through which the system transmits data one character at a time by, for example, getchar. These device nodes often serve for stream communication with devices such as mice, keyboards, virtual terminals, and serial modems, and usually do not support random access to data.

In most implementations, character devices use unbuffered input and output routines. The system reads each character from the device immediately or writes each character to the device immediately.

So, that's cleared that up!
 
Back
Top Bottom