LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-14-2008, 12:24 PM   #1
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Rep: Reputation: 44
Giving meaningful names to disk partitions


After changing/upgrading my distro a few times, I really need to hit GParted and rearrange my hard drive partitions. Trouble is, I'm having difficulty establishing which partitions on my hard drives (I have two) contain what, and my Gnome file manager (Nautilus 2.20.0) is of little help, since the various drives and partitions come up with names like "system", "disk-1", "disk-2" etc, which bear no resemblance to the hda1, hda2, hdb1 etc I am seeing in GParted. Is there a way, or a command in the Shell, I can use to give my partitions more useful names; or any other method I can use to establish which of my drive partitions is which? At the moment, "disk-2" for instance could be any one of them....

Aside from anything else, I am consider putting my current /home onto its own partition, so I would like to tidy it all up a bit before I do this.

Thanks for any advice anyone can give.

Steve Wylie
 
Old 02-14-2008, 12:40 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
How are they named in /etc/fstab?
 
Old 02-14-2008, 12:51 PM   #3
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Sparsely! All it gives me is:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda6
UUID=15e3d9a0-7aaf-48a3-b923-06f4cea88fe7 / ext3 defaults,errors=remount-ro 0 1
# /dev/sda7
UUID=71a57c2b-b2f5-4d51-8ac0-47ad12d07d3c none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec 0 0
 
Old 02-14-2008, 02:14 PM   #4
chilebiker
Member
 
Registered: Jun 2006
Location: Lake District, Chile
Distribution: Arch
Posts: 50

Rep: Reputation: 17
"fdisk -l" and "df -h" will give you more information.
 
Old 02-15-2008, 12:36 PM   #5
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Yeah, but nothing useful. And nothing that tells me how to change the names of the partitions. Is there anything else I can do?
 
Old 02-15-2008, 01:15 PM   #6
weisso5
Member
 
Registered: Oct 2007
Location: New York City
Distribution: Gentoo, FC
Posts: 133

Rep: Reputation: 16
An organized way to figure what is going on and a way to clean things up is (only my opinion):

1. Boot from a LiveCD
2. fdisk -l
3. mkdir /mnt/partition1
4. mkdir /mnt/partition2
5. mkdir /mnt/partitionX
6. Grab Pen and Paper
7. mount /dev/sdbX (or hda whatever your drive type might be) /mnt/partitionX
8. Repeat until everything is mounted.
9. ls -lta /mnt/partition1
10. Write on your piece of paper, what is in that drive
11. Repeat for Each Partition
12. (Optional) Go into fdisk /dev/sdb and edit the disklabel.
13. (Optional) Reformated and Re-install to your liking


-weisso
 
Old 02-15-2008, 01:16 PM   #7
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 863

Rep: Reputation: 45
I have never come across a way of doing what you are after.

What you need to do is edit fstab to mount these partitions under meaningfully named directories.

The KDE programme kdiskfree will list the partitions, their mount points and filesystem types. I don't know if it will run under Gnome. However if you have installed KDE then switch to it for this.

Hope this helped.
 
Old 02-15-2008, 05:23 PM   #8
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Thanks for the info. It seems to me that the system I currently have running (Ubuntu) has set up the fstab just for its own use - and not put in any entries except the one it needs (sda6). I know sda1 has Windows XP on it, and GParted does give me information on the partitions themselves - it was just that I had no direct connection between what I saw in GParted and what I see in the file manager.

I do have a Knoppix DVD and so I shall load this up to see if it gives me any more info on what is what. I just wondered if there was a quick way to give the partitions meaningful labels, but I don't think it's a good idea for an amateur like me to be adding my own stuff into the fstab Ubuntu created when it installed!

Thanks again
Steve
 
Old 02-16-2008, 03:59 AM   #9
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Had an idea, and solved the problem in a round-about way. I booted from a live CD I had of "Puppy Linux", which aside from sitting entirely in RAM also gives you a hard drive listing very simply split into hda1, hda2, hda3 etc, which you have the opportunity of mounting then opening/browsing in a basic file manager. I went through mounting every partition and putting an empty file in each one called "This is on hda3.txt" etc for each partition. Now when I boot into Ubuntu I can call up a certain directory in Nautilus and see which little empty file is in that directory, indicating to me which partition it actually is.

So, got there in the end! Anyway, thanks for the advice I received on this thread.

Steve
 
Old 02-16-2008, 04:14 AM   #10
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Well, it appears I'm too late but in case anyone has a similar question, it is perfectly possible to use labeling. This is the default behaviour on Red Hat alikes (Fedora, CentOS): they attach a label to partitions during install, e.g. /, /tmp, /var, /home, etc. One can do this manually, too. For example, if you have a partition full of movies, there is nothing stopping your from naming it /movies. The nice part is that these labels will be shown even when the system is not mounted, for example when one is using gparted.
 
Old 02-16-2008, 04:47 PM   #11
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
If I did a terminal command: mount /dev/hda3 /mnt/movies

... for example, would this have the effect of labelling hda3 as "movies" in the file manager view, or would that not work and bugger my system up?

And would I need to do the same in fstab, or is fstab for a different purpose?

Steve
 
Old 02-16-2008, 05:03 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Naming the directories where filesystems are mounted would be a good idea for non-system directories. When using your computer, you don't really care whether it is a mounted partition or just a directory.

For system directories, you don't want to change the names. So if you have a partition mounted on /home or /usr, leave it alone. It already has a meaningful name.

Labeling filesystems is a very good idea for removable drives. The next time you plug in a drive it may be assigned a different device. If you label the filesystem it will be automounted over a directory below /media/ by the name of the label. So an external drive labeled "movies" will be mounted /media/movies/.

If you don't use the automount system and want to have an entry in /etc/fstab instead, then instead of a device name you can use "LABEL=movies" or "UUID=<the-uuid-number>". For external drives, use the "noauto" option to prevent the system from hanging when trying to mount a non-attached external drive.

Last edited by jschiwal; 02-16-2008 at 05:43 PM.
 
Old 02-16-2008, 09:38 PM   #13
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Just as a late addition, I was playing with a new partitioning live cd called PartedMagic, and that lets you change the label on partitions.
 
Old 02-18-2008, 01:50 AM   #14
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
If I want to move my /home directory to an existing empty and formatted partition, is it just a matter of adding:

/dev/hda3 /home ext3 defaults 0 0

... to my fstab and moving my files over (and deleting the existing /home directory), or is there more to it than that?

Steve
 
Old 02-18-2008, 02:13 AM   #15
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Yo udon't want to delete the /hpome directory, because you need it as a mount point. You just want /home to be empty
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Giving user/group permissions to read&write Windows partitions? zaqwe Slackware 3 08-26-2007 11:07 AM
Live CD not giving itself much disk space veeruk101 Linux - Newbie 1 01-31-2007 09:22 AM
Dmraid partitions names sorin_ban Fedora 0 07-19-2006 01:15 AM
Disk names mghiya Linux - Hardware 1 04-11-2006 07:40 AM
giving permission to read windows partitions jaakkop Slackware 2 01-13-2005 08:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration