Moving Raspian

I am using Raspian Jesse and have a 120GB SSD Ext4 partition that I would like to use for part of the OS. How do I move things to the SSD and what can be moved?

--
Ben  aka cMech
Reply to
Ben Ritchey
Loading thread data ...
  • An ongoing debate between Martin Gregorie and Ben Ritchey rages on ...

MG > If I'm setting up Linux on a HDD or SDD id normally use these MG > partitions, named for the part of the filing system goes on each: MG > /boot - holds GRUB and the system image(s) - somewhere between 500MB MG > and 1GB is fine MG > swap - traditionally RAM * 2 MG > / - contains root, /bin, /usr/bin, /var. /tmp and /opt 50GB is MG > /home - where all the user directories go. Occupies the rest of the MG > - I also use a small (4GB) encrypted partition for storing MG > sensitive stuff, but thats just me. MG > The obvious (and easiest) bits to put on a separate disk would be MG > /home and the swap area, leaving everything else on the SD card. Or

That's what I was thinking :)

MG > Your choice: what are you thinking of putting on the SSD? and why?

Originally I wanted to decrease the access/activity on the SD card to prolong it's life and since I have had nothing but failures trying to build anything more than a 16GB system on the SD card, it would give me more room {chuckle}. I've tried 32GB and 64GB cards to no avail :( My Pi doesn't like it! lol

.- Keep the faith, --------------------------------------------------. | | | Ben aka cMech Web: http|ftp|binkp|telnet://cmech.dynip.com | | Email: fido4cmech(at)lusfiber.net | | Home page:

formatting link
| `----------- WildCat! Board 24/7 +1-337-984-4794 any BAUD 8,N,1 ---'

... So many musicians are grasshoppers with little thought of the future.

Reply to
Ben Ritchey
  • An ongoing debate between Martin Gregorie and Ben Ritchey rages on ...

MG > I'm not sure to what extent /home is high activity. Bits are for me,

Me either {chuckle} and I do all my dev under Wins :)

MG > but then I'm a C and Java developer and active projects surely count

Assembly and PowerBasic {g}

MG > The other area to look at is what's going on in /var, especially MG > /var/log.

Yes, I thought about var! So if I copy var to the ssd, delete var then symlink var to the ssd var folder, will that work?

MG >

formatting link

Thanks, I'll go peruse that. Since my last post I D/L'd an SD card tester and found out my two 32GB cards were bad, so that's part of the problem lol

.- Keep the faith, --------------------------------------------------. | | | Ben aka cMech Web: http|ftp|binkp|telnet://cmech.dynip.com | | Email: fido4cmech(at)lusfiber.net | | Home page:

formatting link
| `----------- WildCat! Board 24/7 +1-337-984-4794 any BAUD 8,N,1 ---'

... All truly great thoughts are conceived while walking. - Nietzsche

Reply to
Ben Ritchey
  • An ongoing debate between Ahem A Rivet's Shot and Ben Ritchey rages on ...

AS > Yes, but making a filesystem on the SSD and mounting it would AS > be better.

The partition is ext4 and already mounted, I would have to symlink to it :) but

thanks for the info :)

.- Keep the faith, --------------------------------------------------. | | | Ben aka cMech Web: http|ftp|binkp|telnet://cmech.dynip.com | | Email: fido4cmech(at)lusfiber.net | | Home page:

formatting link
| `----------- WildCat! Board 24/7 +1-337-984-4794 any BAUD 8,N,1 ---'

... We write more, but learn less.

Reply to
Ben Ritchey

If I'm setting up Linux on a HDD or SDD id normally use these partitions, named for the part of the filing system goes on each:

/boot - holds GRUB and the system image(s) - somewhere between 500MB and 1GB is fine

swap - traditionally RAM * 2

/ - contains root, /bin, /usr/bin, /var. /tmp and /opt 50GB is about right

/home - where all the user directories go. Occupies the rest of the disk.

- I also use a small (4GB) encrypted partition for storing sensitive stuff, but thats just me.

- some distros (Fedora) mount a transient RAM partition as /tmp

FWIW I've recently set up three machines (two laptops and a desktop) using this scheme one laptop and the desktop have 500GB HDDs and the last laptop has a 128 GB SSD. All are running Fedora and all are running at least as fast as I expected.

The obvious (and easiest) bits to put on a separate disk would be /home and the swap area, leaving everything else on the SD card. Or you could leave only /boot on the SD card and move everything else to the SDD

Your choice: what are you thinking of putting on the SSD? and why? Bear in mind that its going to be connecting through a USB socket anyway, so won't be blindingly fast.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

That makes sense.

I'm not sure to what extent /home is high activity. Bits are for me, but then I'm a C and Java developer and active projects surely count as fairly high activity with files being edited and every few minutes a compile replacing all the binaries. I don't know what the activity pattern would be for non-developers, but I'd guess that its more a case of adding new files at a lower rate.

The other area to look at is what's going on in /var, especially /var/log.

Of course, if you run database(s) and/or local web-sites and an MTA, by default these often store their data in /var, so you can either put that in its own partition on the SSD or you can either:

- symlink those data stores to parts of /home - PostgreSQL defaults to putting its datastore in /usr/lib/pgsql - I replace pgsql with a symlink to /home/postgres

- change their configuration - Apache bases its web pages in, IIRC, /var/lib/html but my config file says its base directory is /home/http/html

I suppose which way to go for this stuff depends on the way you think about such things: in my case I wanted to localise the data I care about in /home because that makes backups easier and because, by putting it all on the one partition I can do a clean install AND keep my data untouched by not reformatting/reinstalling the /home partition. For the full rationale of this approach, see:

formatting link

- my website.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

/var/www...here.

Reasonable approach. I just back up everything tho.

Lost of tweaks in /etc /usr/local /usr/share/... Then when I upgraded I can raid all that for stuff to get back to where I was before I upgraded.

--
"I guess a rattlesnake ain't risponsible fer bein' a rattlesnake, but ah  
puts mah heel on um jess the same if'n I catches him around mah chillun".
Reply to
The Natural Philosopher

Yes, but making a filesystem on the SSD and mounting it would be better.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:>WIN                                      | A better way to focus the sun 
The computer obeys and wins.                |    licences available see 
You lose and Bill collects.                 |    http://www.sohara.org/
Reply to
Ahem A Rivet's Shot

In that case yes the symlink will work for you, it used to be common practice to have /var and /home as symlinks to corresponding directories under /usr.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:>WIN                                      | A better way to focus the sun 
The computer obeys and wins.                |    licences available see 
You lose and Bill collects.                 |    http://www.sohara.org/
Reply to
Ahem A Rivet's Shot

You might want to take a look at the developer tools that come as standard with every Linux: tools like grep and awk are very useful for one-off jobs. For instance, I wanted to look at a series of numbers (used for serialisation) in a collection of 59 source files and list them, sorted by number so I could visually check that there were no duplicates. This did it:

grep -r serialVersionUID *.java | awk -e '{print $8, $1}' | sort -k1

Grep selects the lines containing the number, awk built a line from it containing the filename and serial number, and sort ordered the lines by ascending serial number.

But I digress...

Yes, that's exactly how you'd do it.

Yes, that would have an effect!

I think the trick is to buy SD cards from reputable sellers and only buy brands that are known to own flash fabs. I prefer Sandisk but Samsung should also be OK. Toshiba also own a fab but I don't know their flash brand name(s).

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

Thats easy:

mv /usr/local /home/local # once to get the directory structure which # is empty in a new install ln -s /home/local /usr/local # now backing up /home gets /usr/local too # If you're using Oracle Java, do the same # with /usr/java too

Each time I manually change anything in /etc I make copies of the changed files in my main user directory, i.e. new stuff in /etc/profile.d and mods to /etc/ssh/ssh_config and /etc/ssh/sshd_config. Also a list of the packages I've added to the basic installation (CVS, git, PostgreSQL, ImageMagik...) structured as an executable script.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

be careful. At boot you may need to write to /var before you actually have /home mounted. and that's also a possibility if you boot into single user mode.

Personally I suspect you should think about all the options carefully.

--
Religion is regarded by the common people as true, by the wise as  
foolish, and by the rulers as useful. 

(Seneca the Younger, 65 AD)
Reply to
The Natural Philosopher

That shouldn't be a problem - if he's symlinking it in effect the original root directory hasn't moved and the fstab entry won't have changed. Since the symlink is a permanent pointer to a directory in a partition in the other disk, the part of the var structure that got moved will be available as soon as the contents of fstab have been used to mount all disks and partitions.

That said, if the OP is now moving the whole of /var rather than just /var/log as was initially discussed, I'd be inclined to repartition the disk and put /var in its own partition and modify fstab to mount it.

+1
--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.